Files
go-omni/cmd/go-omni/apigen/testdata/composition/converters.go

22 lines
477 B
Go

package convert
import (
"errors"
"strconv"
)
var ErrName = errors.New("rejected name")
// Explicit project rules: full-form omission clears strings/bools and uses zero
// for required money. Nullable employer amounts remain nil by direct assignment.
func Name(value *string) (string, error) {
if value == nil {
return "", nil
}
if *value == "reject" {
return "", ErrName
}
return *value, nil
}
func ID(value int64) string { return strconv.FormatInt(value, 10) }