printConciseHeader prints a concise header line representing nm to buf. If this function is changed to access different fields of nm, keep in equalConciseHeader in sync.
(buf *strings.Builder)
| 347 | // If this function is changed to access different fields of nm, keep |
| 348 | // in equalConciseHeader in sync. |
| 349 | func (nm *NetworkMap) printConciseHeader(buf *strings.Builder) { |
| 350 | fmt.Fprintf(buf, "netmap: self: %v auth=%v", |
| 351 | nm.NodeKey.ShortString(), nm.GetMachineStatus()) |
| 352 | |
| 353 | var login string |
| 354 | up, ok := nm.UserProfiles[nm.User()] |
| 355 | if ok { |
| 356 | login = up.LoginName() |
| 357 | } |
| 358 | if login == "" { |
| 359 | if nm.User().IsZero() { |
| 360 | login = "?" |
| 361 | } else { |
| 362 | login = fmt.Sprint(nm.User()) |
| 363 | } |
| 364 | } |
| 365 | fmt.Fprintf(buf, " u=%s", login) |
| 366 | fmt.Fprintf(buf, " %v", nm.GetAddresses().AsSlice()) |
| 367 | buf.WriteByte('\n') |
| 368 | } |
| 369 | |
| 370 | // equalConciseHeader reports whether a and b are equal for the fields |
| 371 | // used by printConciseHeader. |
no test coverage detected