Skip to content

Commit

Permalink
internal: simplify map value literal
Browse files Browse the repository at this point in the history
gofmt -s -w -l does this simplification. Running gofmt when this
package is vendored causes the vendored file to be simplified.

Change-Id: I00502ff564bd5cff2614a8372db7beb1eb4519ec
Signed-off-by: Ahmet Alp Balkan <[email protected]>
Reviewed-on: https://go-review.googlesource.com/37013
Reviewed-by: Chris Broadfoot <[email protected]>
  • Loading branch information
ahmetb authored and broady committed Feb 14, 2017
1 parent e1e827d commit b9780ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion internal/oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func ParseKey(key []byte) (*rsa.PrivateKey, error) {

func ParseINI(ini io.Reader) (map[string]map[string]string, error) {
result := map[string]map[string]string{
"": map[string]string{}, // root section
"": {}, // root section
}
scanner := bufio.NewScanner(ini)
currentSection := ""
Expand Down
12 changes: 6 additions & 6 deletions internal/oauth2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ bar = hop
ini = nin
`,
map[string]map[string]string{
"": map[string]string{"root": "toor"},
"foo": map[string]string{"bar": "hop", "ini": "nin"},
"": {"root": "toor"},
"foo": {"bar": "hop", "ini": "nin"},
},
},
{
Expand All @@ -33,9 +33,9 @@ ini = nin
empty=
`,
map[string]map[string]string{
"": map[string]string{},
"empty": map[string]string{},
"section": map[string]string{"empty": ""},
"": {},
"empty": {},
"section": {"empty": ""},
},
},
{
Expand All @@ -45,7 +45,7 @@ empty=
;comment=true
`,
map[string]map[string]string{
"": map[string]string{},
"": {},
},
},
}
Expand Down

0 comments on commit b9780ec

Please sign in to comment.