sijie commented on a change in pull request #4746: [go function] fix: go function should parse conf content first URL: https://github.com/apache/pulsar/pull/4746#discussion_r305262966
########## File path: pulsar-function-go/conf/conf.go ########## @@ -87,16 +87,19 @@ func (c *Conf) GetConf() *Conf { flag.Usage() } + if confContent == "" && confFilePath == "" { + log.Errorf("no yaml file or conf content provided") + return nil + } + if confFilePath != "" { yamlFile, err := ioutil.ReadFile(confFilePath) - if err != nil { - log.Errorf("not found conf file, err:%s", err.Error()) - return nil - } - err = yaml.Unmarshal(yamlFile, c) - if err != nil { - log.Errorf("unmarshal yaml file error:%s", err.Error()) - return nil + if err == nil { Review comment: sgtm ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services