Skip to content

added new rule DL3062 to check go install#1111

Merged
m-ildefons merged 1 commit intohadolint:masterfrom
Danil42Russia:danil42russia/go_install_rules
Sep 11, 2025
Merged

added new rule DL3062 to check go install#1111
m-ildefons merged 1 commit intohadolint:masterfrom
Danil42Russia:danil42russia/go_install_rules

Conversation

@Danil42Russia
Copy link
Copy Markdown
Contributor

@Danil42Russia Danil42Russia commented Aug 20, 2025

Added a new rule for commands:

  1. go run
  2. go install
  3. go tool

Not used

  1. latest version
  2. none version (this leads to deletion)
  3. Not specified at all

Copy link
Copy Markdown
Member

@m-ildefons m-ildefons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Danil,
thanks for this. It looks good to me.
Could you please also update the wiki with a page for this rule?

@m-ildefons m-ildefons merged commit 92374f5 into hadolint:master Sep 11, 2025
2 checks passed
| [DL3059](https://github.com/hadolint/hadolint/wiki/DL3059) | Info | Multiple consecutive `RUN` instructions. Consider consolidation. |
| [DL3060](https://github.com/hadolint/hadolint/wiki/DL3060) | Info | `yarn cache clean` missing after `yarn install` was run. |
| [DL3061](https://github.com/hadolint/hadolint/wiki/DL3061) | Error | Invalid instruction order. Dockerfile must begin with `FROM`, `ARG` or comment. |
| [DL3062](https://github.com/hadolint/hadolint/wiki/DL3061) | Warning | Pin versions in go install. Instead of `go install <package>` use `go install <package>@<version>` |
Copy link
Copy Markdown

@larry-c-ef larry-c-ef Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the wrong address (https://github.com/hadolint/hadolint/wiki/DL3061). And there is no wiki entry for DL3062.

The error message is not helpful enough, especially given that this rule applies to go get and go run, in addition to go install.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go get -v ./... makes the lint triggers, so is it not recommended?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants