1// +build notfastpath 2 3package codec 4 5import "reflect" 6 7// The generated fast-path code is very large, and adds a few seconds to the build time. 8// This causes test execution, execution of small tools which use codec, etc 9// to take a long time. 10// 11// To mitigate, we now support the notfastpath tag. 12// This tag disables fastpath during build, allowing for faster build, test execution, 13// short-program runs, etc. 14 15func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { return false } 16func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { return false } 17func fastpathEncodeTypeSwitchSlice(iv interface{}, e *Encoder) bool { return false } 18func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { return false } 19 20type fastpathT struct{} 21type fastpathE struct { 22 rtid uintptr 23 rt reflect.Type 24 encfn func(*encFnInfo, reflect.Value) 25 decfn func(*decFnInfo, reflect.Value) 26} 27type fastpathA [0]fastpathE 28 29func (x fastpathA) index(rtid uintptr) int { return -1 } 30 31var fastpathAV fastpathA 32var fastpathTV fastpathT 33