diff --git a/gen/genfs/genfs.go b/gen/genfs/genfs.go index 351f6f98a..b0bbe664a 100644 --- a/gen/genfs/genfs.go +++ b/gen/genfs/genfs.go @@ -23,5 +23,5 @@ func (t FormattedSource) WriteFile(name string, content []byte) error { } out = buf } - return os.WriteFile(filepath.Join(t.Root, name), out, 0644) + return os.WriteFile(filepath.Join(t.Root, name), out, 0o644) } diff --git a/gen/schema_gen_sum_test.go b/gen/schema_gen_sum_test.go index 729432a22..43467eb36 100644 --- a/gen/schema_gen_sum_test.go +++ b/gen/schema_gen_sum_test.go @@ -26,12 +26,14 @@ func Test_mergeEnums(t *testing.T) { "a", "b", 0, 2, false, true, - []any{1}, []any{2}, + []any{1}, + []any{2}, }, []any{ "a", "c", 0, 3, true, - []any{1}, []any{[]any{1}}, + []any{1}, + []any{[]any{1}}, }, []any{ "a", 0, diff --git a/internal/integration/e2e_err_test.go b/internal/integration/e2e_err_test.go index 1bab900c7..444517db4 100644 --- a/internal/integration/e2e_err_test.go +++ b/internal/integration/e2e_err_test.go @@ -10,8 +10,7 @@ import ( api "github.com/ogen-go/ogen/internal/integration/sample_err" ) -type sampleErrServer struct { -} +type sampleErrServer struct{} func (s sampleErrServer) DataCreate(ctx context.Context, req api.OptData) (*api.Data, error) { panic("implement me") diff --git a/internal/integration/metrics_test.go b/internal/integration/metrics_test.go index 20134d423..b65857de8 100644 --- a/internal/integration/metrics_test.go +++ b/internal/integration/metrics_test.go @@ -46,8 +46,11 @@ func (h metricsTestHandler) APIKey(ctx context.Context, operationName string) (a } var _ api.Handler = metricsTestHandler{} -var _ api.SecurityHandler = metricsTestHandler{} -var _ api.SecuritySource = metricsTestHandler{} + +var ( + _ api.SecurityHandler = metricsTestHandler{} + _ api.SecuritySource = metricsTestHandler{} +) func labelerMiddleware(req middleware.Request, next middleware.Next) (middleware.Response, error) { labeler, _ := api.LabelerFromContext(req.Context) diff --git a/json/unix_str_test.go b/json/unix_str_test.go index 3c060054a..aff17e815 100644 --- a/json/unix_str_test.go +++ b/json/unix_str_test.go @@ -71,6 +71,6 @@ func TestStringUnix(t *testing.T) { func TestDecodeStringUnixNano(t *testing.T) { got, err := DecodeStringUnixNano(jx.DecodeStr(`"1586960586000000000"`)) require.NoError(t, err) - want := time.Date(2020, 04, 15, 14, 23, 06, 0, time.UTC) + want := time.Date(2020, 0o4, 15, 14, 23, 0o6, 0, time.UTC) require.True(t, want.Equal(got)) } diff --git a/json/unix_test.go b/json/unix_test.go index aea7f1110..0d597f418 100644 --- a/json/unix_test.go +++ b/json/unix_test.go @@ -71,6 +71,6 @@ func TestUnix(t *testing.T) { func TestDecodeUnixNano(t *testing.T) { got, err := DecodeUnixNano(jx.DecodeStr(`1586960586000000000`)) require.NoError(t, err) - want := time.Date(2020, 04, 15, 14, 23, 06, 0, time.UTC) + want := time.Date(2020, 0o4, 15, 14, 23, 0o6, 0, time.UTC) require.True(t, want.Equal(got)) } diff --git a/json/uuid.go b/json/uuid.go index 9db569066..4498ad2b7 100644 --- a/json/uuid.go +++ b/json/uuid.go @@ -21,7 +21,7 @@ func EncodeUUID(s *jx.Encoder, v uuid.UUID) { length = len(v)*2 + 4 quotedLength = length + 2 ) - var dst = [quotedLength]byte{ + dst := [quotedLength]byte{ 0: '"', quotedLength - 1: '"', } diff --git a/validate/errors.go b/validate/errors.go index 42240b693..38a93335a 100644 --- a/validate/errors.go +++ b/validate/errors.go @@ -2,9 +2,10 @@ package validate import ( "fmt" - "github.com/ogen-go/ogen/ogenregex" "strings" + "github.com/ogen-go/ogen/ogenregex" + "github.com/go-faster/errors" )