typeNilKind gives the RLP value kind for nil pointers to 'typ'.
(typ reflect.Type, tags rlpstruct.Tags)
| 213 | |
| 214 | // typeNilKind gives the RLP value kind for nil pointers to 'typ'. |
| 215 | func typeNilKind(typ reflect.Type, tags rlpstruct.Tags) Kind { |
| 216 | styp := rtypeToStructType(typ, nil) |
| 217 | |
| 218 | var nk rlpstruct.NilKind |
| 219 | if tags.NilOK { |
| 220 | nk = tags.NilKind |
| 221 | } else { |
| 222 | nk = styp.DefaultNilValue() |
| 223 | } |
| 224 | switch nk { |
| 225 | case rlpstruct.NilKindString: |
| 226 | return String |
| 227 | case rlpstruct.NilKindList: |
| 228 | return List |
| 229 | default: |
| 230 | panic("invalid nil kind value") |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | func isUint(k reflect.Kind) bool { |
| 235 | return k >= reflect.Uint && k <= reflect.Uintptr |
no test coverage detected