pulumi/pkg/codegen/hcl2/model
Abhinav Gupta acda1e3b13
all: Fix revive issues
Fixes the following issues found by revive
included in the latest release of golangci-lint.

Full list of issues:

**pkg**

```
backend/display/object_diff.go:47:10: superfluous-else: if block ends with a break statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
backend/display/object_diff.go:716:12: redefines-builtin-id: redefinition of the built-in function delete (revive)
backend/display/object_diff.go:742:14: redefines-builtin-id: redefinition of the built-in function delete (revive)
backend/display/object_diff.go:983:10: superfluous-else: if block ends with a continue statement, so drop this else and outdent its block (revive)
backend/httpstate/backend.go:1814:4: redefines-builtin-id: redefinition of the built-in function cap (revive)
backend/httpstate/backend.go:1824:5: redefines-builtin-id: redefinition of the built-in function cap (revive)
backend/httpstate/client/client.go:444:2: if-return: redundant if ...; err != nil check, just return error instead. (revive)
backend/httpstate/client/client.go:455:2: if-return: redundant if ...; err != nil check, just return error instead. (revive)
cmd/pulumi/org.go:113:4: if-return: redundant if ...; err != nil check, just return error instead. (revive)
cmd/pulumi/util.go:216:2: if-return: redundant if ...; err != nil check, just return error instead. (revive)
codegen/docs/gen.go:428:2: redefines-builtin-id: redefinition of the built-in function copy (revive)
codegen/hcl2/model/expression.go:2151:5: redefines-builtin-id: redefinition of the built-in function close (revive)
codegen/hcl2/syntax/comments.go:151:2: redefines-builtin-id: redefinition of the built-in function close (revive)
codegen/hcl2/syntax/comments.go:329:3: redefines-builtin-id: redefinition of the built-in function close (revive)
codegen/hcl2/syntax/comments.go:381:5: redefines-builtin-id: redefinition of the built-in function close (revive)
codegen/nodejs/gen.go:1367:5: redefines-builtin-id: redefinition of the built-in function copy (revive)
codegen/python/gen_program_expressions.go:136:2: redefines-builtin-id: redefinition of the built-in function close (revive)
codegen/python/gen_program_expressions.go:142:3: redefines-builtin-id: redefinition of the built-in function close (revive)
codegen/report/report.go:126:6: redefines-builtin-id: redefinition of the built-in function panic (revive)
codegen/schema/docs_test.go:210:10: superfluous-else: if block ends with a continue statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
codegen/schema/schema.go:790:2: redefines-builtin-id: redefinition of the built-in type any (revive)
codegen/schema/schema.go:793:4: redefines-builtin-id: redefinition of the built-in type any (revive)
resource/deploy/plan.go:506:2: if-return: redundant if ...; err != nil check, just return error instead. (revive)
resource/deploy/snapshot_test.go:59:3: redefines-builtin-id: redefinition of the built-in function copy (revive)
resource/deploy/state_builder.go:108:2: redefines-builtin-id: redefinition of the built-in function copy (revive)
```

**sdk**

```
go/common/resource/plugin/context.go:142:2: redefines-builtin-id: redefinition of the built-in function copy (revive)
go/common/resource/plugin/plugin.go:142:12: superfluous-else: if block ends with a break statement, so drop this else and outdent its block (revive)
go/common/resource/properties_diff.go:114:2: redefines-builtin-id: redefinition of the built-in function len (revive)
go/common/resource/properties_diff.go:117:4: redefines-builtin-id: redefinition of the built-in function len (revive)
go/common/resource/properties_diff.go:122:4: redefines-builtin-id: redefinition of the built-in function len (revive)
go/common/resource/properties_diff.go:127:4: redefines-builtin-id: redefinition of the built-in function len (revive)
go/common/resource/properties_diff.go:132:4: redefines-builtin-id: redefinition of the built-in function len (revive)
go/common/util/deepcopy/copy.go:30:1: redefines-builtin-id: redefinition of the built-in function copy (revive)
go/common/workspace/creds.go:242:2: if-return: redundant if ...; err != nil check, just return error instead. (revive)
go/pulumi-language-go/main.go:569:2: if-return: redundant if ...; err != nil check, just return error instead. (revive)
go/pulumi-language-go/main.go:706:2: if-return: redundant if ...; err != nil check, just return error instead. (revive)
go/pulumi/run_test.go:925:2: redefines-builtin-id: redefinition of the built-in type any (revive)
go/pulumi/run_test.go:933:3: redefines-builtin-id: redefinition of the built-in type any (revive)
nodejs/cmd/pulumi-language-nodejs/main.go:778:2: if-return: redundant if ...; err != nil check, just return error instead. (revive)
python/cmd/pulumi-language-python/main.go:1011:2: if-return: redundant if ...; err != nil check, just return error instead. (revive)
python/cmd/pulumi-language-python/main.go:863:2: if-return: redundant if ...; err != nil check, just return error instead. (revive)
python/python.go:230:2: redefines-builtin-id: redefinition of the built-in function print (revive)
```

**tests**

```
integration/integration_util_test.go:282:11: superfluous-else: if block ends with a continue statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
```
2023-03-21 08:55:11 -07:00
..
format all: Assert => Assertf 2023-03-03 14:37:43 -08:00
pretty all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
attribute.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
binder_expression.go all: Assert => Assertf 2023-03-03 14:37:43 -08:00
binder_expression_test.go ci: radical idea - what if slow tests & no stdout makes GH consider runner dead? 2022-03-06 14:52:13 -08:00
block.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
body.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
diagnostics.go Handle recursive types 2023-01-13 11:28:13 -08:00
expression.go all: Fix revive issues 2023-03-21 08:55:11 -07:00
functions.go Initial implementation of simplified invokes for dotnet and nodejs 2023-01-11 14:17:14 -08:00
print_test.go Escape `${` & `%{` in string literals 2022-12-08 10:46:23 +01:00
printer.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
scope.go Remove traverse errors on dynamic types 2022-11-16 14:41:30 -08:00
spec.md Add an HCL2 static typechecker and semantic model. (#4087) 2020-03-18 09:28:57 -07:00
traversable.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
type.go all: Assert => Assertf 2023-03-03 14:37:43 -08:00
type_collection.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
type_const.go golangci-lint: Enable staticcheck 2023-01-14 16:59:46 -08:00
type_enum.go pkg/hcl2/model: Make String methods thread-safe 2023-01-18 16:18:17 -08:00
type_eventuals.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
type_list.go Handle recursive types 2023-01-13 11:28:13 -08:00
type_map.go Handle recursive types 2023-01-13 11:28:13 -08:00
type_none.go Pretty print PCL types 2022-12-19 17:13:15 +01:00
type_object.go all: Assert => Assertf 2023-03-03 14:37:43 -08:00
type_opaque.go all: Assert => Assertf 2023-03-03 14:37:43 -08:00
type_opaque_test.go [codegen] simplify opaque types to string newtype (#9770) 2022-06-13 11:13:03 -07:00
type_output.go Handle recursive types 2023-01-13 11:28:13 -08:00
type_promise.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
type_scope.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
type_set.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
type_test.go Allow case insensitive prop typecheck on traversal 2022-11-08 09:08:12 -08:00
type_tuple.go pkg/hcl2/model: Make String methods thread-safe 2023-01-18 16:18:17 -08:00
type_union.go pkg/hcl2/model: Make String methods thread-safe 2023-01-18 16:18:17 -08:00
utilities.go all: Assert => Assertf 2023-03-03 14:37:43 -08:00
visitor.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00