Skip to content

Commit 06fb9e3

Browse files
authored
Merge pull request #5057 from alexandear/refactor/usestdlibvars
refactor: enable usestdlibvars linter
2 parents 0c23c27 + d1a979c commit 06fb9e3

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

.golangci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ linters:
2929
- unconvert
3030
- unused
3131
- usetesting
32+
- usestdlibvars
3233
- whitespace
3334
settings:
3435
depguard:
@@ -133,6 +134,10 @@ linters:
133134
- -ST1000
134135
- -ST1001 # duplicates revive.dot-imports
135136
- -ST1022
137+
usestdlibvars:
138+
http-method: false
139+
time-date-month: true
140+
time-layout: true
136141
usetesting:
137142
os-temp-dir: true
138143
context-background: true

cmd/limactl/watch.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,11 @@ func isInstanceDir(path string) bool {
238238
}
239239

240240
func printStatus(out io.Writer, msg string) {
241-
fmt.Fprintf(out, "%s %s\n", time.Now().Format("2006-01-02 15:04:05"), msg)
241+
fmt.Fprintf(out, "%s %s\n", time.Now().Format(time.DateTime), msg)
242242
}
243243

244244
func printHumanReadableEvent(out io.Writer, instName string, ev events.Event) {
245-
timestamp := ev.Time.Format("2006-01-02 15:04:05")
245+
timestamp := ev.Time.Format(time.DateTime)
246246

247247
printEvent := func(msg string) {
248248
fmt.Fprintf(out, "%s %s | %s\n", timestamp, instName, msg)

pkg/plist/plist_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func TestUnmarshalPlist(t *testing.T) {
7373
" intKey with\n\t\t\tspaces": {Integer: ptr.Of(int64(43))},
7474
"intKeyZero": {Integer: ptr.Of(int64(0))},
7575
"dataKey": {Data: []byte("hello")},
76-
"dateKey": {Date: ptr.Of(time.Date(2020, 1, 2, 3, 4, 5, 0, time.UTC))},
76+
"dateKey": {Date: ptr.Of(time.Date(2020, time.January, 2, 3, 4, 5, 0, time.UTC))},
7777
"trueKey": {Boolean: ptr.Of(true)},
7878
"falseKey": {Boolean: ptr.Of(false)},
7979
"realKey": {Real: ptr.Of(3.14)},

0 commit comments

Comments
 (0)