(s any)
| 89 | } |
| 90 | |
| 91 | func uniqueID(s any) (string, error) { |
| 92 | var b bytes.Buffer |
| 93 | |
| 94 | if err := gob.NewEncoder(&b).Encode(s); err != nil { |
| 95 | return "", fmt.Errorf("unable to generate unique name: %w", err) |
| 96 | } |
| 97 | |
| 98 | h := fnv.New64a() |
| 99 | if _, err := h.Write(b.Bytes()); err != nil { |
| 100 | return "", fmt.Errorf("unable to generate unique name: %w", err) |
| 101 | } |
| 102 | |
| 103 | return fmt.Sprintf("%016x", h.Sum64()), nil |
| 104 | } |
no test coverage detected