Closed mattdot closed 4 months ago
@mawasile please fix these linting errors on this branch/pr
Error: internal/powerplatform/services/data_record/api_data_record.go:280:16: Error return value of
json.Unmarshal
is not checked (errcheck) json.Unmarshal(response.BodyAsBytes, &mapResponse) ^ Error: internal/powerplatform/services/data_record/api_data_record.go:309:16: Error return value ofjson.Unmarshal
is not checked (errcheck) json.Unmarshal(response.BodyAsBytes, &mapResponse) ^ Error: internal/powerplatform/services/data_record/api_data_record.go:425:17: Error return value ofjson.Unmarshal
is not checked (errcheck) json.Unmarshal(response.BodyAsBytes, &result) ^ Error: internal/powerplatform/services/application/api_application.go:148:22: Error return value ofresponse.MarshallTo
is not checked (errcheck) response.MarshallTo(&appCreatedResponse) ^ Error: internal/powerplatform/services/environment/api_environment.go:377:25: Error return value ofapiResponse.MarshallTo
is not checked (errcheck) apiResponse.MarshallTo(&envCreatedResponse) ^ Error: internal/powerplatform/resource_data_record_test.go:1119:17: Error return value ofreq.Body.Read
is not checked (errcheck) req.Body.Read(bodyAsBytes) ^ Error: internal/powerplatform/services/rest/api_rest.go:100:29: func(*WebApiClient).getEnvironmentUrlById
is unused (unused) func (client WebApiClient) getEnvironmentUrlById(ctx context.Context, environmentId string) (string, error) { ^ Error: internal/powerplatform/services/rest/api_rest.go:109:29: func `(WebApiClient).getEnvironmentis unused (unused) func (client *WebApiClient) getEnvironment(ctx context.Context, environmentId string) (*EnvironmentIdDto, error) { ^ Error: internal/powerplatform/services/dlp_policy/models_dlp_policy.go:165:5: var
environmentSetObjectType` is unused (unused) var environmentSetObjectType = types.ObjectType{ ^ Error: internal/powerplatform/services/authorization/api_user.go:295:111: S1039: unnecessary use of fmt.Sprintf (gosimple) return nil, powerplatform_helpers.WrapIntoProviderError(err, powerplatform_helpers.ERROR_OBJECT_NOT_FOUND, fmt.Sprintf("security roles not found")) ^ Error: internal/powerplatform/api/api_client.go:92:3: ineffectual assignment to isStatusCodeValid (ineffassign) isStatusCodeValid = true ^ Error: internal/powerplatform/api/auth.go:70:24: ineffectual assignment to err (ineffassign) azureCertCredentials, err := azidentity.NewClientCertificateCredential( ^ Error: internal/powerplatform/api/auth.go:276:2: ineffectual assignment to tokenExpiry (ineffassign) tokenExpiry := time.Time{} ^ Error: internal/powerplatform/mocks/known_state_value.go:37:9: SA4001: &x will be simplified to x. It will not copy x. (staticcheck) return &v.value.Value ^
This pull request primarily focuses on integrating
golangci-lint
into the project's workflow and settings. There are three main changes: a new GitHub workflow was added to rungolangci-lint
on push and pull request events, the Visual Studio Code settings were updated to usegolangci-lint
as the Go linting tool, and themakefile
was updated to usegolangci-lint
in thelint
command.GitHub Workflow:
.github/workflows/golangci-lint.yml
: A new workflow was added that runsgolangci-lint
onpush
andpull_request
events to themain
branch. It sets up a Go environment with a stable version and uses thegolangci-lint-action
with versionv1.59
.Visual Studio Code Settings:
.vscode/settings.json
: The settings were updated to usegolangci-lint
as the Go linting tool with the--fast
flag.Makefile:
makefile
: Thelint
command was updated to usegolangci-lint run
instead of the previoustfproviderlintx
command.