Declare url outside of if else statement

This commit is contained in:
Eliot Whalan 2016-06-23 13:22:57 +10:00
parent e4138172af
commit 2d827f5b64
1 changed files with 3 additions and 2 deletions

View File

@ -92,10 +92,11 @@ func save(raw string, lang string) []string {
} }
} }
id := generateName() id := generateName()
var url string
if lang == "" { if lang == "" {
url := ADDRESS + "/p/" + id url = ADDRESS + "/p/" + id
} else { } else {
url := ADDRESS + "/p/" + id + "/" + lang url = ADDRESS + "/p/" + id + "/" + lang
} }
delKey := uniuri.NewLen(40) delKey := uniuri.NewLen(40)
paste := html.EscapeString(raw) paste := html.EscapeString(raw)