Update users.go
This commit is contained in:
parent
687c953931
commit
f69d7c3f06
|
@ -67,6 +67,10 @@ func PreferenceHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
user := conf.GetUser(username)
|
user := conf.GetUser(username)
|
||||||
|
|
||||||
if "GET" == r.Method {
|
if "GET" == r.Method {
|
||||||
|
tmpLinux := user.GoBuildArgsForLinux
|
||||||
|
tmpWindows := user.GoBuildArgsForWindows
|
||||||
|
tmpDarwin := user.GoBuildArgsForDarwin
|
||||||
|
|
||||||
user.GoBuildArgsForLinux = strings.Replace(user.GoBuildArgsForLinux, `"`, `"`, -1)
|
user.GoBuildArgsForLinux = strings.Replace(user.GoBuildArgsForLinux, `"`, `"`, -1)
|
||||||
user.GoBuildArgsForWindows = strings.Replace(user.GoBuildArgsForWindows, `"`, `"`, -1)
|
user.GoBuildArgsForWindows = strings.Replace(user.GoBuildArgsForWindows, `"`, `"`, -1)
|
||||||
user.GoBuildArgsForDarwin = strings.Replace(user.GoBuildArgsForDarwin, `"`, `"`, -1)
|
user.GoBuildArgsForDarwin = strings.Replace(user.GoBuildArgsForDarwin, `"`, `"`, -1)
|
||||||
|
@ -82,11 +86,18 @@ func PreferenceHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
logger.Error(err)
|
logger.Error(err)
|
||||||
http.Error(w, err.Error(), 500)
|
http.Error(w, err.Error(), 500)
|
||||||
|
|
||||||
|
user.GoBuildArgsForLinux = tmpLinux
|
||||||
|
user.GoBuildArgsForWindows = tmpWindows
|
||||||
|
user.GoBuildArgsForDarwin = tmpDarwin
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
t.Execute(w, model)
|
t.Execute(w, model)
|
||||||
|
|
||||||
|
user.GoBuildArgsForLinux = tmpLinux
|
||||||
|
user.GoBuildArgsForWindows = tmpWindows
|
||||||
|
user.GoBuildArgsForDarwin = tmpDarwin
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue