MCPcopy Index your code
hub / github.com/go-dev-frame/sponge / getDefaultValue

Function getDefaultValue

pkg/sql2code/parser/parser.go:1342–1353  ·  view source on GitHub ↗
(expr ast.ExprNode)

Source from the content-addressed store, hash-verified

1340}
1341
1342func getDefaultValue(expr ast.ExprNode) (value string) {
1343 if expr.GetDatum().Kind() != types.KindNull {
1344 value = fmt.Sprintf("%v", expr.GetDatum().GetValue())
1345 } else if expr.GetFlag() != ast.FlagConstant {
1346 if expr.GetFlag() == ast.FlagHasFunc {
1347 if funcExpr, ok := expr.(*ast.FuncCallExpr); ok {
1348 value = funcExpr.FnName.O
1349 }
1350 }
1351 }
1352 return value
1353}

Callers 1

makeCodeFunction · 0.85

Calls 1

GetValueMethod · 0.80

Tested by

no test coverage detected