Skip to content

Commit

Permalink
lang: funcs: structs: Improve naming
Browse files Browse the repository at this point in the history
These could print nicer for debugging.
  • Loading branch information
purpleidea committed Dec 8, 2024
1 parent 5ff4f04 commit 3342c04
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lang/funcs/structs/composite.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ type CompositeFunc struct {
// String returns a simple name for this function. This is needed so this struct
// can satisfy the pgraph.Vertex interface.
func (obj *CompositeFunc) String() string {
if obj.Type != nil {
return fmt.Sprintf("%s: %s", CompositeFuncName, obj.Type.String())
}
return CompositeFuncName
}

Expand Down
5 changes: 3 additions & 2 deletions lang/funcs/structs/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ func (obj *ConstFunc) String() string {
if obj.NameHint != "" {
return obj.NameHint
}
if obj.Value != nil && obj.Value.Type() != nil {
return fmt.Sprintf("%s: %s(%s)", ConstFuncName, obj.Value.Type().String(), obj.Value.String())
}
return ConstFuncName
//return fmt.Sprintf("%s: %s(%s)", ConstFuncName, obj.Value.Type().String(), obj.Value.String())
//return fmt.Sprintf("%s(%s)", obj.Value.Type().String(), obj.Value.String())
}

// Validate makes sure we've built our struct properly.
Expand Down

0 comments on commit 3342c04

Please sign in to comment.