function 'GetVolumeWithSize' seems to be a getter but it does not return any result
355 vs.getVolume(w, req, false)
356}
357
358func (vs *VolumeServer) GetVolumeWithSize(w http.ResponseWriter, req *http.Request) {359 vs.getVolume(w, req, true)
360}
361
function 'GetVolume' seems to be a getter but it does not return any result
351 }
352}
353
354func (vs *VolumeServer) GetVolume(w http.ResponseWriter, req *http.Request) {355 vs.getVolume(w, req, false)
356}
357
function 'getVolume' seems to be a getter but it does not return any result
319 }
320}
321
322func (vs *VolumeServer) getVolume(w http.ResponseWriter, req *http.Request, withSize bool) {323 w.Header().Set("Content-Type", "application/json")
324
325 handle := rata.Param(req, "handle")
Description
Typically, functions with names prefixed with Get are supposed to return a value.
Bad practice
func GetData(n int) {
fmt.Println(10 - n)
}
Recommended
func GetData(n int) int {
fmt.Println(10 - n)
return 10 - n
}