Skip to content

Commit 4ff1562

Browse files
authored
Merge pull request #214 from dmur1/fix-last-line-of-config-in-readme-#211
don't put a comma on the last line of the example json config in the …
2 parents b89c710 + c9f42b8 commit 4ff1562

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,6 @@ if a file called `writeup.md` already exists the command will abort
596596
"googlecloudregion": "",
597597
"googlecloudsshkey": "",
598598
"chefurl": "",
599-
"ctftimeurl": "",
599+
"ctftimeurl": ""
600600
}
601601
```

commands/readme.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,11 @@ func Readme(args []string) {
133133

134134
for i := 0; i < t.NumField(); i++ {
135135
field := t.Field(i)
136-
fmt.Fprintf(os.Stdout, " \"%s\": \"%s\",\n", field.Tag.Get("json"), "")
136+
fmt.Fprintf(os.Stdout, " \"%s\": \"%s\"", field.Tag.Get("json"), "")
137+
if (i + 1) != t.NumField() {
138+
fmt.Fprintf(os.Stdout, ",")
139+
}
140+
fmt.Fprintf(os.Stdout, "\n")
137141
}
138142

139143
fmt.Fprintf(os.Stdout, "}\n```\n")

0 commit comments

Comments
 (0)