示例#1
0
// GetUUIDValid get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652',
// 'd1399005-30f7-40d6-8da6-dd7c89ad34db',
// 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']
func getUUID() []uuid.UUID {
	u1, _ := uuid.FromString("6dcc7237-45fe-45c4-8a6b-3a8a3f625652")
	u2, _ := uuid.FromString("d1399005-30f7-40d6-8da6-dd7c89ad34db")
	u3, _ := uuid.FromString("f42f6aa1-a5bc-4ddf-907e-5f915de43205")
	return []uuid.UUID{
		u1,
		u2,
		u3,
	}
}
示例#2
0
func validateUUID(v interface{}, k string) (ws []string, errors []error) {
	if _, err := uuid.FromString(v.(string)); err != nil {
		errors = append(errors, fmt.Errorf("%q is an invalid UUUID: %s", k, err))
	}
	return
}