Skip to content

Commit 4fa63cc

Browse files
committed
chore: minor clean up
1 parent 331d29b commit 4fa63cc

File tree

3 files changed

+34
-31
lines changed

3 files changed

+34
-31
lines changed

.golangci.next.reference.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Options for analysis running.
88
run:
9-
# Number of operating system threads (`GOMAXPROCS`) that can execute golangci-lint simultaneously.
9+
# Number of operating system threads (`GOMAXPROCS`) that can execute golangci-lint simultaneously.
1010
# If it is explicitly set to 0 (i.e. not the default) then golangci-lint will automatically set the value to match Linux container CPU quota.
1111
# Default: the number of logical CPUs in the machine
1212
concurrency: 4

cmd/golangci-lint/main.go

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -35,41 +35,44 @@ func createBuildInfo() commands.BuildInfo {
3535
Date: date,
3636
}
3737

38-
if buildInfo, available := debug.ReadBuildInfo(); available {
39-
info.GoVersion = buildInfo.GoVersion
40-
41-
if date == "" {
42-
info.Version = buildInfo.Main.Version
43-
44-
var revision string
45-
var modified string
46-
for _, setting := range buildInfo.Settings {
47-
// The `vcs.xxx` information is only available with `go build`.
48-
// This information is are not available with `go install` or `go run`.
49-
switch setting.Key {
50-
case "vcs.time":
51-
info.Date = setting.Value
52-
case "vcs.revision":
53-
revision = setting.Value
54-
case "vcs.modified":
55-
modified = setting.Value
56-
}
57-
}
38+
buildInfo, available := debug.ReadBuildInfo()
39+
if !available {
40+
return info
41+
}
5842

59-
if revision == "" {
60-
revision = "unknown"
61-
}
43+
info.GoVersion = buildInfo.GoVersion
6244

63-
if modified == "" {
64-
modified = "?"
65-
}
45+
if date == "" {
46+
info.Version = buildInfo.Main.Version
6647

67-
if info.Date == "" {
68-
info.Date = "(unknown)"
48+
var revision string
49+
var modified string
50+
for _, setting := range buildInfo.Settings {
51+
// The `vcs.xxx` information is only available with `go build`.
52+
// This information is not available with `go install` or `go run`.
53+
switch setting.Key {
54+
case "vcs.time":
55+
info.Date = setting.Value
56+
case "vcs.revision":
57+
revision = setting.Value
58+
case "vcs.modified":
59+
modified = setting.Value
6960
}
61+
}
7062

71-
info.Commit = fmt.Sprintf("(%s, modified: %s, mod sum: %q)", revision, modified, buildInfo.Main.Sum)
63+
if revision == "" {
64+
revision = "unknown"
7265
}
66+
67+
if modified == "" {
68+
modified = "?"
69+
}
70+
71+
if info.Date == "" {
72+
info.Date = "(unknown)"
73+
}
74+
75+
info.Commit = fmt.Sprintf("(%s, modified: %s, mod sum: %q)", revision, modified, buildInfo.Main.Sum)
7376
}
7477

7578
return info

docs/src/docs/usage/install/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ Each phase corresponds to a minor version:
167167
- v1.1.0 -> error message
168168
- v1.2.0 -> linter removed
169169

170-
Otherwise, the deprecated linters are removed from presets immediately when they are deprecated (phase 1).
170+
The deprecated linters are removed from presets immediately when they are deprecated (phase 1).
171171

172172
We will provide clear information about those changes on different supports: changelog, logs, social network, etc.
173173

0 commit comments

Comments
 (0)