meshery / meshery-adapter-library

Library of common functionality for Meshery Adapters
Apache License 2.0
22 stars 32 forks source link

updated go to 1.17 #83

Closed jbyers19 closed 2 years ago

jbyers19 commented 2 years ago

Signed-off-by: Jared Byers j.byers@f5.com

Description

Ran go mod verify and go vet ./... locally to test changes.

Edit: Had to make a couple more changes to fix lint failures:

  1. Updated golangci-lint to v1.45 latest in the workflow.
  2. Switched from strings.Title to cases.Title. Tested the change locally to ensure the output would be the same:
    
    mesh_type := "NGINX_SERVICE_MESH"
    strings_name := strings.Title(strings.ToLower(strings.ReplaceAll(mesh_type, "_", " ")))
    cases_name := cases.Title(language.Und).String(strings.ReplaceAll(mesh_type, "_", " "))

Output: strings: Nginx Service Mesh cases: Nginx Service Mesh



**[Signed commits](../blob/master/CONTRIBUTING.md#signing-off-on-commits-developer-certificate-of-origin)**
- [X] Yes, I signed my commits.
leecalcote commented 2 years ago

@alphaX86 given you recent focus on golanglint-ci, will you have a look at the failed check here?

jbyers19 commented 2 years ago

Update: fixed the lint error via code change. Still don't know why the error didn't show up locally.

@alphaX86, I bumped golangci-lint to the latest version (v1.45) and this fixed most of the errors. However, there's still 1 error in the GitHub action. I ran the same command locally with the same version of golangci-lint and am not seeing this error. Is there a caching issue perhaps?

Here's the command I ran locally. The only output is this warning, but no errors.

$ golangci-lint run --out-format=github-actions --exclude G306
WARN [runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner.  Replaced by revive. 
jbyers19 commented 2 years ago

@alphaX86 given you recent focus on golanglint-ci, will you have a look at the failed check here?

Thanks, @leecalcote. I figured how to fix the lint issues. See the updated description for details.

alphaX86 commented 2 years ago

Update: fixed the lint error via code change. Still don't know why the error didn't show up locally.

@alphaX86, I bumped golangci-lint to the latest version (v1.45) and this fixed most of the errors. However, there's still 1 error in the GitHub action. I ran the same command locally with the same version of golangci-lint and am not seeing this error. Is there a caching issue perhaps?

Here's the command I ran locally. The only output is this warning, but no errors.

$ golangci-lint run --out-format=github-actions --exclude G306
WARN [runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner.  Replaced by revive. 

It might be due to the old config present in repo. Seems you've fixed all issues 😅 sorry I was in rest at that time. Anyway 👍

alphaX86 commented 2 years ago

And since the golang is upgraded to 1.17 now, it's also needed that the golangci-lint must use go 1.17 instead of go 1.13 (by default in GitHub actions)

jbyers19 commented 2 years ago

Thanks, @alphaX86. I updated the workflow with your suggestions.

jbyers19 commented 2 years ago

@leecalcote, can this be merged now?

welcome[bot] commented 2 years ago

Thanks for your contribution to the Layer5 community! :tada:

Congrats!