Closed andycook-bcs closed 7 years ago
I'm trying to return the duple from getting the value in a map, but goreturns is breaking the code.
Orignal/Expected:
func (r *Request) GetHeader(key string) (string, bool) { if r.Headers == nil { return "", false } return r.Headers[key] }
After:
func (r *Request) GetHeader(key string) (string, bool) { if r.Headers == nil { return "", false } return "", r.Headers[key] }
Workaround
func (r *Request) GetHeader(key string) (string, bool) { if r.Headers == nil { return "", false } value, ok := r.Headers[key] return value, ok }
Nope that code doesn't work any way!
I'm trying to return the duple from getting the value in a map, but goreturns is breaking the code.
Orignal/Expected:
After:
Workaround