Skip to content

Commit 1162ee1

Browse files
committed
move file text to a constant
1 parent 0c24f4a commit 1162ee1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

main.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ import (
2020

2121
const maxConcurrency = 10
2222

23+
const txtTemplate = `
24+
Address: {{.Address}}
25+
Seed: {{.Seed}}
26+
`
27+
2328
var positions = []string{
2429
"anywhere",
2530
"end",
@@ -136,10 +141,7 @@ func writeFinalMessage(pair *keypair.Full, index int64, u string) {
136141
}
137142
defer f.Close()
138143

139-
t := template.Must(template.New("t2").Parse(`
140-
Address: {{.Address}}
141-
Seed: {{.Seed}}
142-
`))
144+
t := template.Must(template.New("t2").Parse(txtTemplate))
143145

144146
if err := t.Execute(f, struct{ Address, Seed string }{pair.Address(), pair.Seed()}); err != nil {
145147
log.Fatal(err)

0 commit comments

Comments
 (0)