more lint driven refactoring

This commit is contained in:
evilsocket 2018-04-24 18:26:16 +02:00
parent 7919cda5ec
commit 0de6f3a76e
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
57 changed files with 168 additions and 241 deletions

View file

@ -77,15 +77,11 @@ func (j *JSRequest) UpdateHash() {
func (j *JSRequest) WasModified() bool {
// body was read
if j.bodyRead == true {
if j.bodyRead {
return true
}
// check if any of the fields has been changed
newHash := j.NewHash()
if newHash != j.refHash {
return true
}
return false
return j.NewHash() != j.refHash
}
func (j *JSRequest) GetHeader(name, deflt string) string {
@ -137,7 +133,7 @@ func (j *JSRequest) ParseForm() map[string]string {
j.Body = j.ReadBody()
}
form := make(map[string]string, 0)
form := make(map[string]string)
parts := strings.Split(j.Body, "&")
for _, part := range parts {
@ -171,7 +167,7 @@ func (j *JSRequest) ToRequest() (req *http.Request) {
}
}
if hadType == false && j.ContentType != "" {
if !hadType && j.ContentType != "" {
req.Header.Set("Content-Type", j.ContentType)
}