refactoring

This commit is contained in:
Chris Lu
2020-04-12 21:00:55 -07:00
parent 8e23dc078b
commit 7764e0465c
16 changed files with 186 additions and 187 deletions

View File

@@ -167,10 +167,10 @@ func setEtag(w http.ResponseWriter, etag string) {
}
}
func getEtag(resp *http.Response) (etag string){
func getEtag(resp *http.Response) (etag string) {
etag = resp.Header.Get("ETag")
if strings.HasPrefix(etag, "\"") && strings.HasSuffix(etag, "\""){
return etag[1:len(etag)-1]
if strings.HasPrefix(etag, "\"") && strings.HasSuffix(etag, "\"") {
return etag[1 : len(etag)-1]
}
return
}