control/controlclient: remove a number literal in string slice offset

This commit is contained in:
Brad Fitzpatrick 2020-03-13 09:48:12 -07:00
parent 42e98d4edc
commit 19cc4f8b8e

View File

@ -100,8 +100,9 @@ func (nm *NetworkMap) Concise() string {
} }
derp := p.DERP derp := p.DERP
if strings.HasPrefix(derp, "127.3.3.40:") { const derpPrefix = "127.3.3.40:"
derp = "D" + derp[11:] if strings.HasPrefix(derp, derpPrefix) {
derp = "D" + derp[len(derpPrefix):]
} }
// Most of the time, aip is just one element, so format the // Most of the time, aip is just one element, so format the