Declare url outside of if else statement

This commit is contained in:
Eliot Whalan 2016-06-23 13:22:57 +10:00
parent 33fc4a9df4
commit 6f985b8142
No known key found for this signature in database
GPG Key ID: C0A42175139840D6
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)