remove stupid variable name

Signed-off-by: Odyssey346 <odyssey346@disroot.org>
This commit is contained in:
Odyssey346 2022-07-28 21:37:41 +02:00
parent d24c5eecee
commit 13af65c965

10
main.go
View File

@ -14,18 +14,18 @@ type StaticThingy struct {
Port string Port string
} }
var pieceof string var port string
var shit bool var shit bool
func main() { func main() {
log.Println("[Segfautilities] Starting") log.Println("[Segfautilities] Starting")
otherthings.CheckEnv() otherthings.CheckEnv()
log.Println("[HTTP] Starting server") log.Println("[HTTP] Starting server")
pieceof := os.Getenv("SEGFAUTILITIES_PORT") port := os.Getenv("SEGFAUTILITIES_PORT")
tmpl := template.Must(template.ParseFiles("static/index.html")) tmpl := template.Must(template.ParseFiles("static/index.html"))
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
data := StaticThingy{ data := StaticThingy{
Port: pieceof, Port: port,
} }
tmpl.Execute(w, data) tmpl.Execute(w, data)
}) })
@ -33,6 +33,6 @@ func main() {
io.WriteString(w, "welcome to hell") io.WriteString(w, "welcome to hell")
}) })
api.Form() api.Form()
log.Println("[HTTP] HTTP server is now running at " + pieceof + "!") log.Println("[HTTP] HTTP server is now running at " + port + "!")
log.Println(http.ListenAndServe(":" + pieceof, nil)) log.Println(http.ListenAndServe(":" + port, nil))
} }