formatMapKey formats v as if it were a map key. The result is guaranteed to be a single line.
(v reflect.Value, disambiguate bool, ptrs *pointerReferences)
| 357 | // formatMapKey formats v as if it were a map key. |
| 358 | // The result is guaranteed to be a single line. |
| 359 | func formatMapKey(v reflect.Value, disambiguate bool, ptrs *pointerReferences) string { |
| 360 | var opts formatOptions |
| 361 | opts.DiffMode = diffIdentical |
| 362 | opts.TypeMode = elideType |
| 363 | opts.PrintAddresses = disambiguate |
| 364 | opts.AvoidStringer = disambiguate |
| 365 | opts.QualifiedNames = disambiguate |
| 366 | opts.VerbosityLevel = maxVerbosityPreset |
| 367 | opts.LimitVerbosity = true |
| 368 | s := opts.FormatValue(v, reflect.Map, ptrs).String() |
| 369 | return strings.TrimSpace(s) |
| 370 | } |
| 371 | |
| 372 | // formatString prints s as a double-quoted or backtick-quoted string. |
| 373 | func formatString(s string) string { |
no test coverage detected