MCPcopy Index your code
hub / github.com/aptly-dev/aptly / truthy

Function truthy

api/api.go:177–195  ·  view source on GitHub ↗
(value interface{})

Source from the content-addressed store, hash-verified

175}
176
177func truthy(value interface{}) bool {
178 if value == nil {
179 return false
180 }
181 switch v := value.(type) {
182 case string:
183 switch strings.ToLower(v) {
184 case "n", "no", "f", "false", "0", "off":
185 return false
186 default:
187 return true
188 }
189 case int:
190 return v != 0
191 case bool:
192 return v
193 }
194 return true
195}
196
197func maybeRunTaskInBackground(c *gin.Context, name string, resources []string, proc task.Process) {
198 // Run this task in background if configured globally or per-request

Callers 2

maybeRunTaskInBackgroundFunction · 0.85
TestTruthyMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestTruthyMethod · 0.68