Files
.github
alerting
client
config
controller
core
docs
example
jsonpath
k8s
k8stest
metric
pattern
security
storage
util
vendor
cloud.google.com
github.com
TwinProduction
beorn7
cespare
davecgh
go-ping
gogo
golang
google
googleapis
gorilla
imdario
json-iterator
kballard
mattn
matttproud
miekg
modern-go
concurrent
reflect2
.gitignore
.travis.yml
Gopkg.lock
Gopkg.toml
LICENSE
README.md
go_above_17.go
go_above_19.go
go_below_17.go
go_below_19.go
reflect2.go
reflect2_amd64.s
reflect2_kind.go
relfect2_386.s
relfect2_amd64p32.s
relfect2_arm.s
relfect2_arm64.s
relfect2_mips64x.s
relfect2_mipsx.s
relfect2_ppc64x.s
relfect2_s390x.s
safe_field.go
safe_map.go
safe_slice.go
safe_struct.go
safe_type.go
test.sh
type_map.go
unsafe_array.go
unsafe_eface.go
unsafe_field.go
unsafe_iface.go
unsafe_link.go
unsafe_map.go
unsafe_ptr.go
unsafe_slice.go
unsafe_struct.go
unsafe_type.go
prometheus
remyoudompheng
spf13
go.etcd.io
golang.org
google.golang.org
gopkg.in
k8s.io
lukechampine.com
modernc.org
sigs.k8s.io
modules.txt
watchdog
web
.dockerignore
.gitattributes
.gitignore
Dockerfile
LICENSE.md
Makefile
README.md
config.yaml
go.mod
go.sum
main.go
gatus/vendor/github.com/modern-go/reflect2/safe_struct.go
TwinProduction cf923af230 Fix dependencies
2020-12-25 03:02:44 -05:00

30 lines
781 B
Go

package reflect2
type safeStructType struct {
safeType
}
func (type2 *safeStructType) FieldByName(name string) StructField {
field, found := type2.Type.FieldByName(name)
if !found {
panic("field " + name + " not found")
}
return &safeField{StructField: field}
}
func (type2 *safeStructType) Field(i int) StructField {
return &safeField{StructField: type2.Type.Field(i)}
}
func (type2 *safeStructType) FieldByIndex(index []int) StructField {
return &safeField{StructField: type2.Type.FieldByIndex(index)}
}
func (type2 *safeStructType) FieldByNameFunc(match func(string) bool) StructField {
field, found := type2.Type.FieldByNameFunc(match)
if !found {
panic("field match condition not found in " + type2.Type.String())
}
return &safeField{StructField: field}
}