MCPcopy
hub / github.com/danielgtaylor/huma / floatTag

Function floatTag

schema.go:375–384  ·  view source on GitHub ↗
(f reflect.StructField, tag string)

Source from the content-addressed store, hash-verified

373}
374
375func floatTag(f reflect.StructField, tag string) *float64 {
376 if v := f.Tag.Get(tag); v != "" {
377 if i, err := strconv.ParseFloat(v, 64); err == nil {
378 return &i
379 } else {
380 panic(fmt.Errorf("invalid float tag '%s' for field '%s': %v (%w)", tag, f.Name, v, err))
381 }
382 }
383 return nil
384}
385
386func stringTag(f reflect.StructField, tag string, def string) string {
387 if v := f.Tag.Get(tag); v != "" {

Callers 1

SchemaFromFieldFunction · 0.85

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…