-
-
Notifications
You must be signed in to change notification settings - Fork 110
/
octal-literals.txtar
60 lines (50 loc) · 922 Bytes
/
octal-literals.txtar
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Initially, the Go language version is too low.
exec gofumpt -l .
! stdout .
# We can give an explicitly newer version.
exec gofumpt -lang=1.13 -l .
stdout -count=1 'foo\.go'
stdout -count=1 'nested[/\\]nested\.go'
# If we bump the version in go.mod, it should be picked up.
exec go mod edit -go=1.13
exec gofumpt -l .
stdout -count=1 'foo\.go'
! stdout 'nested'
# Ensure we produce the output we expect, and that it's stable.
exec gofumpt foo.go
cmp stdout foo.go.golden
exec gofumpt -d foo.go.golden
! stdout .
# We can give an explicitly older version, too
exec gofumpt -lang=1.0 -l .
! stdout .
-- go.mod --
module test
go 1.12
-- foo.go --
package p
const (
i = 0
j = 022
k = 0o_7_5_5
l = 1022
)
-- foo.go.golden --
package p
const (
i = 0
j = 0o22
k = 0o_7_5_5
l = 1022
)
-- nested/go.mod --
module nested
go 1.11
-- nested/nested.go --
package p
const (
i = 0
j = 022
k = 0o_7_5_5
l = 1022
)