Update name of latest distribution path const

This commit is contained in:
gammazero 2021-03-16 16:57:44 -07:00
parent 077266d3bd
commit 1430a0104c
3 changed files with 5 additions and 5 deletions

View File

@ -55,7 +55,7 @@ func createFakeArchive(name string, archZip bool, w io.Writer) {
func TestGetDistPath(t *testing.T) {
os.Unsetenv(envIpfsDistPath)
distPath := GetDistPathEnv("")
if distPath != IpnsIpfsDist {
if distPath != LatestIpfsDist {
t.Error("did not set default dist path")
}

View File

@ -9,8 +9,8 @@ import (
const (
// Current dirstibution to fetch migrations from
CurrentIpfsDist = "/ipfs/Qme8pJhBidEUXRdpcWLGR2fkG5kdwVnaMh3kabjfP8zz7Y"
// Distribution IPNS path. Default for fetchers.
IpnsIpfsDist = "/ipns/dist.ipfs.io"
// Latest distribution path. Default for fetchers.
LatestIpfsDist = "/ipns/dist.ipfs.io"
// Distribution environ variable
envIpfsDistPath = "IPFS_DIST_PATH"
@ -77,7 +77,7 @@ func GetDistPathEnv(distPath string) string {
return dist
}
if distPath == "" {
return IpnsIpfsDist
return LatestIpfsDist
}
return distPath
}

View File

@ -32,7 +32,7 @@ var _ Fetcher = (*HttpFetcher)(nil)
// Specifying 0 for fetchLimit sets the default, -1 means no limit.
func NewHttpFetcher(distPath, gateway, userAgent string, fetchLimit int64) *HttpFetcher {
f := &HttpFetcher{
distPath: IpnsIpfsDist,
distPath: LatestIpfsDist,
gateway: defaultGatewayURL,
limit: defaultFetchLimit,
}