Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add golangci-lint #181

Merged
merged 5 commits into from
Feb 11, 2024
Merged

Add golangci-lint #181

merged 5 commits into from
Feb 11, 2024

Conversation

juev
Copy link
Collaborator

@juev juev commented Feb 10, 2024

Using golangci-link makes it easier to check the code and avoid a lot of problems.

This is only a draft of changes so far.

First, after changing the golang version to 1.22 in the go.mod file, many utilities stopped working. According to issue, we corrected the version, specifying it more precisely. After that, everything worked as it should.

Performed adding a new pipe and configuration for golangci-lint to standardize checks.

At the current moment, we have a number of problems that I plan to fix in the current PR.

Please do not merge this changes until they are ready to go.

After updating golang to 1.22 we have error:
```
go: download go1.22 for darwin/arm64: toolchain not available
```

golang/go#65568

Just set full version for golang to fix this issue
goland added this automatically :)
Using golangci-link makes it easier to check the code and avoid a lot of problems
@juev
Copy link
Collaborator Author

juev commented Feb 10, 2024

Copy link

CoverItUp Report

TYPE MASTER FEATURE/GOLANGCI-LINT
coverage 60.5% 59.2%-
build-time 3sec 3sec
go-binary-size 6.1kKB 6.1kKB
go-mod-dependencies 29 28-
go-sec-issues 6 6
unit-test-run-time 18sec 18sec

chartchartchartchartchartchart

Add Badges and Charts to Readme

@kevincobain2000
Copy link
Owner

Before you and/or I start fixing - please look at this too #182

@juev
Copy link
Collaborator Author

juev commented Feb 10, 2024

Now I have registered a list of linters that I use in regular projects. Just because they often help me find certain errors.

We can remove the bodyclose linter, as it is currently not working correctly. And we can remove predeclared, since it is not quite relevant.

We can either correct other errors or ignore them.

Copy link

CoverItUp Report

TYPE MASTER FEATURE/GOLANGCI-LINT
go-sec-issues 6 5-
go-lint-errors 0 0

chartchart

Add Badges and Charts to Readme

@juev juev changed the title Draft: Add golangci-lint Add golangci-lint Feb 10, 2024
@juev
Copy link
Collaborator Author

juev commented Feb 10, 2024

@kevincobain2000 I think that it is possible to check.

If you have any ideas about what other linters to enable or disable, you can discuss it here and now. :)

If you have any comments about the selected constant names, I am ready to listen and discuss suggestions.

Copy link

CoverItUp Report

TYPE MASTER FEATURE/GOLANGCI-LINT
go-lint-errors 0 0

chart

Add Badges and Charts to Readme

@kevincobain2000
Copy link
Owner

Thanks I ll push the new tag once you are ready.
Please merge when you are cool with it.

@kevincobain2000 kevincobain2000 merged commit de3d482 into master Feb 11, 2024
14 checks passed
@kevincobain2000 kevincobain2000 deleted the feature/golangci-lint branch February 11, 2024 11:07
@juev
Copy link
Collaborator Author

juev commented Feb 11, 2024

@kevincobain2000 Hi, I'm sorry, I was out of the access zone, I couldn't get in touch.
Thank you for your prompt response!

@kevincobain2000
Copy link
Owner

No worries. Thanks.
I haven’t pushed the new tag after the changes. Only merged changes to master.
Will do that tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants