mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 23:00:58 +00:00
lib/api: String comparisons
This commit is contained in:
parent
0c8b22c696
commit
6baa93e13f
@ -572,7 +572,7 @@ func loadRelays(file string) []*relay {
|
||||
|
||||
var relays []*relay
|
||||
for _, line := range strings.Split(string(content), "\n") {
|
||||
if len(line) == 0 {
|
||||
if line == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -1017,7 +1017,7 @@ func (s *service) postSystemReset(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
if len(folder) == 0 {
|
||||
if folder == "" {
|
||||
// Reset all folders.
|
||||
for folder := range s.cfg.Folders() {
|
||||
if err := s.model.ResetFolder(folder); err != nil {
|
||||
|
@ -81,7 +81,7 @@ func (s *staticsServer) serveAsset(w http.ResponseWriter, r *http.Request) {
|
||||
file = file[1:]
|
||||
}
|
||||
|
||||
if len(file) == 0 {
|
||||
if file == "" {
|
||||
file = "index.html"
|
||||
}
|
||||
|
||||
@ -136,7 +136,7 @@ func (s *staticsServer) serveFromAssetDir(file, theme string, w http.ResponseWri
|
||||
return false
|
||||
}
|
||||
mtype := assets.MimeTypeForFile(file)
|
||||
if len(mtype) != 0 {
|
||||
if mtype == "" {
|
||||
w.Header().Set("Content-Type", mtype)
|
||||
}
|
||||
http.ServeFile(w, r, p)
|
||||
|
Loading…
Reference in New Issue
Block a user