[fix] Fixed empty response
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
4dab09e66b
commit
69b4179102
@ -12,9 +12,6 @@ func init() {
|
||||
ErrLoadingEnvs = godotenv.Load()
|
||||
}
|
||||
|
||||
func init() {
|
||||
}
|
||||
|
||||
func GetEnv(name, defVal string) string {
|
||||
env := os.Getenv(name)
|
||||
if env == "" {
|
||||
|
@ -68,7 +68,9 @@ func encodeResponse(w http.ResponseWriter, res *response, err error) {
|
||||
}
|
||||
|
||||
w.WriteHeader(res.Status)
|
||||
json.NewEncoder(w).Encode(res.Data)
|
||||
if res.Data != nil {
|
||||
json.NewEncoder(w).Encode(res.Data)
|
||||
}
|
||||
}
|
||||
|
||||
func encodeError(w http.ResponseWriter, status int, e error) {
|
||||
|
Loading…
Reference in New Issue
Block a user