1
// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
2
// Use of this source code is governed by a MIT license found in the LICENSE file.
4
//go:build notfastpath || codec.notfastpath
5
// +build notfastpath codec.notfastpath
11
const fastpathEnabled = false
13
// The generated fast-path code is very large, and adds a few seconds to the build time.
14
// This causes test execution, execution of small tools which use codec, etc
15
// to take a long time.
17
// To mitigate, we now support the notfastpath tag.
18
// This tag disables fastpath during build, allowing for faster build, test execution,
19
// short-program runs, etc.
21
func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { return false }
22
func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { return false }
24
// func fastpathEncodeTypeSwitchSlice(iv interface{}, e *Encoder) bool { return false }
25
// func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { return false }
27
func fastpathDecodeSetZeroTypeSwitch(iv interface{}) bool { return false }
29
type fastpathT struct{}
30
type fastpathE struct {
33
encfn func(*Encoder, *codecFnInfo, reflect.Value)
34
decfn func(*Decoder, *codecFnInfo, reflect.Value)
36
type fastpathA [0]fastpathE
38
func fastpathAvIndex(rtid uintptr) int { return -1 }
40
var fastpathAv fastpathA
41
var fastpathTV fastpathT