Skip to content

Commit e7c4589

Browse files
build(deps): bump github.com/sashamelentyev/usestdlibvars from 1.28.0 to 1.29.0 (#5828)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent ee5054a commit e7c4589

8 files changed

+23
-4
lines changed

.golangci.next.reference.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3616,6 +3616,9 @@ linters:
36163616
# Suggest the use of http.StatusXX.
36173617
# Default: true
36183618
http-status-code: false
3619+
# Suggest the use of time.Month in time.Date.
3620+
# Default: false
3621+
time-date-month: true
36193622
# Suggest the use of time.Weekday.String().
36203623
# Default: true
36213624
time-weekday: true

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ require (
9797
github.com/sanposhiho/wastedassign/v2 v2.1.0
9898
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2
9999
github.com/sashamelentyev/interfacebloat v1.1.0
100-
github.com/sashamelentyev/usestdlibvars v1.28.0
100+
github.com/sashamelentyev/usestdlibvars v1.29.0
101101
github.com/securego/gosec/v2 v2.22.4
102102
github.com/shirou/gopsutil/v4 v4.25.4
103103
github.com/sirupsen/logrus v1.9.3

go.sum

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jsonschema/golangci.next.jsonschema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3728,6 +3728,11 @@
37283728
"type": "boolean",
37293729
"default": false
37303730
},
3731+
"time-date-month": {
3732+
"description": "Suggest the use of time.Month in time.Date.",
3733+
"type": "boolean",
3734+
"default": false
3735+
},
37313736
"crypto-hash": {
37323737
"description": "Suggest the use of crypto.Hash.String().",
37333738
"type": "boolean",

pkg/config/linters_settings.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,7 @@ type UseStdlibVarsSettings struct {
934934
SQLIsolationLevel bool `mapstructure:"sql-isolation-level"`
935935
TLSSignatureScheme bool `mapstructure:"tls-signature-scheme"`
936936
ConstantKind bool `mapstructure:"constant-kind"`
937+
TimeDateMonth bool `mapstructure:"time-date-month"`
937938
}
938939

939940
type UseTestingSettings struct {

pkg/golinters/usestdlibvars/testdata/usestdlibvars_non_default.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
//golangcitest:config_path testdata/usestdlibvars_non_default.yml
33
package testdata
44

5-
import "net/http"
5+
import (
6+
"net/http"
7+
"time"
8+
)
69

710
func _200() {
811
_ = 200
@@ -52,3 +55,8 @@ const (
5255
_ = "ECDSAWithP256AndSHA256" // want `"ECDSAWithP256AndSHA256" can be replaced by tls\.ECDSAWithP256AndSHA256\.String\(\)`
5356
_ = "ECDSAWithP384AndSHA384" // want `"ECDSAWithP384AndSHA384" can be replaced by tls\.ECDSAWithP384AndSHA384\.String\(\)`
5457
)
58+
59+
func _() {
60+
var _ = time.Date(2023, 1, 2, 3, 4, 5, 0, time.UTC) // want `"1" can be replaced by time\.January`
61+
var _ = time.Date(2023, 10, 2, 3, 4, 5, 0, time.UTC) // want `"10" can be replaced by time\.October`
62+
}

pkg/golinters/usestdlibvars/testdata/usestdlibvars_non_default.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ linters:
1313
sql-isolation-level: true
1414
tls-signature-scheme: true
1515
constant-kind: true
16+
time-date-month: true

pkg/golinters/usestdlibvars/usestdlibvars.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ func New(settings *config.UseStdlibVarsSettings) *goanalysis.Linter {
2424
analyzer.TimeMonthFlag: settings.TimeMonth,
2525
analyzer.TimeWeekdayFlag: settings.TimeWeekday,
2626
analyzer.TLSSignatureSchemeFlag: settings.TLSSignatureScheme,
27+
analyzer.TimeDateMonthFlag: settings.TimeDateMonth,
2728
}
2829
}
2930

0 commit comments

Comments
 (0)