UniqueNameWith returns a unique name with a custom delimiter. See UniqueName for details on uniqueness guarantees.
(delim string)
| 55 | // UniqueNameWith returns a unique name with a custom delimiter. |
| 56 | // See UniqueName for details on uniqueness guarantees. |
| 57 | func UniqueNameWith(delim string) string { |
| 58 | name := NameWith(delim) + strconv.FormatInt(counter.Add(1), 10) |
| 59 | return truncate(name, maxNameLen) |
| 60 | } |
| 61 | |
| 62 | // truncate truncates a name to maxLen characters. It assumes the name ends with |
| 63 | // a numeric suffix and preserves it, truncating the base name portion instead. |