Unix code style
mintzhao opened this issue · comments
Description
I'm looking the code, and I found there are some codes which depend on Unix/Linux, not support Windows, such as file path.
Describe How to Reproduce
IE: package core/db
func getDBPath() string {
dbPath := viper.GetString("peer.fileSystemPath")
if dbPath == "" {
panic("DB path not specified in configuration file. Please check that property 'peer.fileSystemPath' is set")
}
if !strings.HasSuffix(dbPath, "/") {
dbPath = dbPath + "/"
}
return dbPath + "db"
}
Why not using:
return filepath.Join(dbPath, "db")
Is windows available?