Skip to content

Commit

Permalink
Fix gosimple warnings in the code base
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas11 committed May 31, 2024
1 parent d12bd45 commit d6fa1be
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 18 deletions.
8 changes: 2 additions & 6 deletions infer/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -705,9 +705,7 @@ func (i *inputField) Computed() InputField {
input.kind = inputComputed
// Copy input fields
input.fields = make([]introspect.FieldTag, len(i.fields))
for i, f := range i.fields {
input.fields[i] = f
}
copy(input.fields, i.fields)
return input
}

Expand All @@ -716,9 +714,7 @@ func (i *inputField) Secret() InputField {
input.kind = inputSecret
// Copy input fields
input.fields = make([]introspect.FieldTag, len(i.fields))
for i, f := range i.fields {
input.fields[i] = f
}
copy(input.fields, i.fields)
return input
}

Expand Down
4 changes: 0 additions & 4 deletions infer/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,6 @@ func TestInvalidOptionalProperty(t *testing.T) {
type invalidContainsOptionalEnum struct {
Foo MyEnum `pulumi:"name,optional"`
}
type validContainsEnum struct {
Foo MyEnum `pulumi:"name"`
}

type testInner struct {
Foo string `pulumi:"foo"`
}
Expand Down
5 changes: 0 additions & 5 deletions middleware/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,6 @@ type state struct {
innerGetSchema func(ctx context.Context, req p.GetSchemaRequest) (p.GetSchemaResponse, error)
}

func (s *state) invalidateCache() {
s.schema = nil
s.combinedSchema = nil
}

type Options struct {
Metadata
// Resources from which to derive the schema
Expand Down
5 changes: 2 additions & 3 deletions provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,8 @@ func GetSchema(ctx context.Context, name, version string, provider Provider) (sc
if err != nil {
errs.Errors = append(errs.Errors, err)
}
for _, err := range collectingDiag.errs.Errors {
errs.Errors = append(errs.Errors, err)
}
errs.Errors = append(errs.Errors, collectingDiag.errs.Errors...)

spec := schema.PackageSpec{}
if err := errs.ErrorOrNil(); err != nil {
return spec, err
Expand Down

0 comments on commit d6fa1be

Please sign in to comment.