membphis commented on a change in pull request #693:
URL: https://github.com/apache/apisix-dashboard/pull/693#discussion_r517779631
##########
File path: api/conf/conf.go
##########
@@ -79,12 +82,19 @@ type Config struct {
}
func init() {
- flag.StringVar(&confDir, "c", "./conf/", "conf dir")
- flag.Parse()
+ //go test
+ if strings.HasSuffix(os.Args[0], ".test") {
+ _, basePath, _, _ := runtime.Caller(0)
+ confDir = filepath.Dir(basePath) + "/"
+ fmt.Println("confDir:", confDir)
+ } else {
+ flag.StringVar(&confDir, "c", "./conf/", "conf dir")
Review comment:
`flag.StringVar(&confDir, "c", "./conf/", "conf dir")`
to
`flag.StringVar(&confDir, "c", "conf/config.yaml", "config file path")`
----------------------------------------------------------------
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:
[email protected]