(s string)
| 39 | } |
| 40 | |
| 41 | func Base64URLDecode(s string) (string, error) { |
| 42 | s = strings.TrimSpace(s) |
| 43 | saver := s |
| 44 | if len(s)%4 > 0 { |
| 45 | s += strings.Repeat("=", 4-len(s)%4) |
| 46 | } |
| 47 | raw, err := base64.URLEncoding.DecodeString(s) |
| 48 | if err != nil { |
| 49 | return saver, err |
| 50 | } |
| 51 | return string(raw), nil |
| 52 | } |
| 53 | |
| 54 | func ObjectToKV(v interface{}, tagName string) (kv []string) { |
| 55 | a := structs.New(v) |
no outgoing calls
no test coverage detected