frostfs-sdk-go/api/util/protogen/internalgengo/writer.go
Pavel Pogodaev 6ce73790ea
All checks were successful
DCO / DCO (pull_request) Successful in 38s
Tests and linters / Tests (pull_request) Successful in 1m13s
Tests and linters / Lint (pull_request) Successful in 2m36s
[#276] Merge repo with frostfs-api-go
Signed-off-by: Pavel Pogodaev <p.pogodaev@yadro.com>
2024-10-22 14:05:12 +00:00

30 lines
465 B
Go

package internalgengo
import (
"fmt"
)
type condition = func(string) string
var (
_ condition = notZero
_ condition = notEmpty
_ condition = identity
_ condition = notNil
)
func notZero(name string) string {
return fmt.Sprintf("%s != 0", name)
}
func notEmpty(name string) string {
return fmt.Sprintf("len(%s) != 0", name)
}
func identity(name string) string {
return name
}
func notNil(name string) string {
return fmt.Sprintf("%s != nil", name)
}