diff --git a/config.go b/config.go index 88110cb6..b9ca0c51 100644 --- a/config.go +++ b/config.go @@ -27,6 +27,7 @@ import ( "github.com/decred/dcrd/database" _ "github.com/decred/dcrd/database/ffldb" "github.com/decred/dcrd/mempool" + "github.com/decred/dcrd/sampleconfig" "github.com/decred/dcrutil" ) @@ -353,7 +354,7 @@ func createDefaultConfigFile(destPath string) error { // file contents with their generated values. rpcUserRE := regexp.MustCompile(`(?m)^;\s*rpcuser=[^\s]*$`) rpcPassRE := regexp.MustCompile(`(?m)^;\s*rpcpass=[^\s]*$`) - s := rpcUserRE.ReplaceAllString(sampleConfigFileContents, rpcUserLine) + s := rpcUserRE.ReplaceAllString(sampleconfig.FileContents, rpcUserLine) s = rpcPassRE.ReplaceAllString(s, rpcPassLine) // Create config file at the provided path. diff --git a/sampleconfig.go b/sampleconfig/sampleconfig.go similarity index 98% rename from sampleconfig.go rename to sampleconfig/sampleconfig.go index 7f26de59..8464a833 100644 --- a/sampleconfig.go +++ b/sampleconfig/sampleconfig.go @@ -2,9 +2,10 @@ // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. -package main +package sampleconfig -var sampleConfigFileContents = `[Application Options] +// FileContents is a string containing the commented example config for dcrd. +var FileContents = `[Application Options] ; ------------------------------------------------------------------------------ ; Data settings