mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-08 22:31:04 +00:00
golint style tweaks
This commit is contained in:
parent
963077f918
commit
618a8682b7
@ -937,12 +937,12 @@ next:
|
|||||||
|
|
||||||
// If rate limiting is set, we wrap the connection in a
|
// If rate limiting is set, we wrap the connection in a
|
||||||
// limiter.
|
// limiter.
|
||||||
var wr io.Writer = conn
|
wr := io.Writer(conn)
|
||||||
if writeRateLimit != nil {
|
if writeRateLimit != nil {
|
||||||
wr = &limitedWriter{conn, writeRateLimit}
|
wr = &limitedWriter{conn, writeRateLimit}
|
||||||
}
|
}
|
||||||
|
|
||||||
var rd io.Reader = conn
|
rd := io.Reader(conn)
|
||||||
if readRateLimit != nil {
|
if readRateLimit != nil {
|
||||||
rd = &limitedReader{conn, readRateLimit}
|
rd = &limitedReader{conn, readRateLimit}
|
||||||
}
|
}
|
||||||
@ -1015,7 +1015,7 @@ func listenTLS(conns chan *tls.Conn, addr string, tlsCfg *tls.Config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func dialTLS(m *model.Model, conns chan *tls.Conn, tlsCfg *tls.Config) {
|
func dialTLS(m *model.Model, conns chan *tls.Conn, tlsCfg *tls.Config) {
|
||||||
var delay time.Duration = 1 * time.Second
|
delay := time.Second
|
||||||
for {
|
for {
|
||||||
nextDevice:
|
nextDevice:
|
||||||
for deviceID, deviceCfg := range cfg.Devices() {
|
for deviceID, deviceCfg := range cfg.Devices() {
|
||||||
@ -1154,9 +1154,8 @@ func getDefaultConfDir() (string, error) {
|
|||||||
default:
|
default:
|
||||||
if xdgCfg := os.Getenv("XDG_CONFIG_HOME"); xdgCfg != "" {
|
if xdgCfg := os.Getenv("XDG_CONFIG_HOME"); xdgCfg != "" {
|
||||||
return filepath.Join(xdgCfg, "syncthing"), nil
|
return filepath.Join(xdgCfg, "syncthing"), nil
|
||||||
} else {
|
|
||||||
return osutil.ExpandTilde("~/.config/syncthing")
|
|
||||||
}
|
}
|
||||||
|
return osutil.ExpandTilde("~/.config/syncthing")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -888,13 +888,12 @@ func (m *Model) folderStatRef(folder string) *stats.FolderStatisticsReference {
|
|||||||
m.fmut.Lock()
|
m.fmut.Lock()
|
||||||
defer m.fmut.Unlock()
|
defer m.fmut.Unlock()
|
||||||
|
|
||||||
if sr, ok := m.folderStatRefs[folder]; ok {
|
sr, ok := m.folderStatRefs[folder]
|
||||||
return sr
|
if !ok {
|
||||||
} else {
|
|
||||||
sr = stats.NewFolderStatisticsReference(m.db, folder)
|
sr = stats.NewFolderStatisticsReference(m.db, folder)
|
||||||
m.folderStatRefs[folder] = sr
|
m.folderStatRefs[folder] = sr
|
||||||
return sr
|
|
||||||
}
|
}
|
||||||
|
return sr
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Model) receivedFile(folder, filename string) {
|
func (m *Model) receivedFile(folder, filename string) {
|
||||||
|
Loading…
Reference in New Issue
Block a user