MCPcopy Create free account
hub / github.com/coder/coder / hasPricing

Method hasPricing

scripts/aibridgepricesgen/main.go:59–65  ·  view source on GitHub ↗

hasPricing reports whether the cost block has at least one populated price. Returns false for a nil receiver, so callers can pass m.Cost without a preceding nil check.

()

Source from the content-addressed store, hash-verified

57// Returns false for a nil receiver, so callers can pass m.Cost without a
58// preceding nil check.
59func (c *upstreamCost) hasPricing() bool {
60 if c == nil {
61 return false
62 }
63 return c.Input != nil || c.Output != nil ||
64 c.CacheRead != nil || c.CacheWrite != nil
65}
66
67// Pointer fields preserve the distinction between "not populated by upstream"
68// (null) and "explicitly zero" (0).

Callers 1

convertFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected