You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log.Fatalf("cannot parse machine id into int. (MACHINE_ID = %s) ", machineID)
50
+
fori:=0; i < 100; i++ {
51
+
fmt.Println(g.NewID())
109
52
}
110
-
return i
111
-
}
112
-
113
-
funcmustGetEnv(keystring) string {
114
-
v, ok:= os.LookupEnv(key)
115
-
if !ok {
116
-
log.Fatalf("%s environment key not found.\n", key)
117
-
}
118
-
return v
119
53
}
120
54
```
55
+
121
56
## Examples
122
57
123
58
```sh
124
59
cat-ab-ce093c1
125
60
cat-ac-ce093c1
126
61
cat-ad-ce093c1
127
-
dog-ae-ce093c1
128
-
dog-af-ce093c1
129
-
dog-b0-ce093c1
130
-
b1-ce093c1
131
-
b2-ce093c1
132
-
b3-ce093c1
133
62
```
134
63
135
-
136
64
## Design
137
65
138
66
The implementation is loosely based on the following article: [Creating User-Facing, Short Unique IDs: What are the options? - Hwee Lin Yeo, Alexandra](https://medium.com/teamocard/creating-user-facing-short-unique-id-ids-what-are-the-options-464a19283d98)
0 commit comments