MCPcopy Index your code
hub / github.com/google/go-github / zeroValueOfIdent

Function zeroValueOfIdent

github/gen-accessors.go:352–365  ·  view source on GitHub ↗
(x *ast.Ident)

Source from the content-addressed store, hash-verified

350}
351
352func zeroValueOfIdent(x *ast.Ident) string {
353 switch x.String() {
354 case "int", "int64", "float64", "uint8", "uint16":
355 return "0"
356 case "string":
357 return `""`
358 case "bool":
359 return "false"
360 case "Timestamp":
361 return "Timestamp{}"
362 default:
363 return "nil"
364 }
365}
366
367func genIdentGetter(x *ast.Ident, receiverType, fieldName string) *getter {
368 zeroValue := zeroValueOfIdent(x)

Callers 2

addSimpleValueIdentMethod · 0.85
genIdentGetterFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…