hyperledger-archives / fabric

THIS IS A READ-ONLY historic repository. Current development is at https://gerrit.hyperledger.org/r/#/admin/projects/fabric . pull requests not accepted

Home Page:https://gerrit.hyperledger.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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?

@mintzhao thanks for submitting this suggestion. Note that we've transitioned to Jira and Gerrit for Hyperledger development. Please open an issue in Jira and if you like, a pull request would be most welcome. Thanks!