fix: Function params involve heavy amount of copying (#622)

This commit is contained in:
Bo-Yi Wu
2021-08-02 14:07:30 +08:00
committed by GitHub
parent 6d65c1ea6e
commit 349c0c8c1d
21 changed files with 87 additions and 88 deletions

View File

@@ -276,8 +276,8 @@ type SectionGRPC struct {
}
// LoadConf load config from file and read in environment variables that match
func LoadConf(confPath ...string) (ConfYaml, error) {
var conf ConfYaml
func LoadConf(confPath ...string) (*ConfYaml, error) {
conf := &ConfYaml{}
viper.SetConfigType("yaml")
viper.AutomaticEnv() // read in environment variables that match

View File

@@ -19,8 +19,8 @@ func TestMissingFile(t *testing.T) {
type ConfigTestSuite struct {
suite.Suite
ConfGorushDefault ConfYaml
ConfGorush ConfYaml
ConfGorushDefault *ConfYaml
ConfGorush *ConfYaml
}
func (suite *ConfigTestSuite) SetupTest() {