Skip to content

Commit 7c870f3

Browse files
GrapeBaBagaborh-da
authored andcommitted
Remove unused code
The code in core/config.go has no call path, remove this dead code. Change-Id: Ic2adbc0b6cebfb56e663ad00a40eccddb14044ae Signed-off-by: grapebaba <[email protected]>
1 parent a087441 commit 7c870f3

File tree

1 file changed

+0
-54
lines changed

1 file changed

+0
-54
lines changed

core/config.go

-54
Original file line numberDiff line numberDiff line change
@@ -17,64 +17,10 @@ limitations under the License.
1717
package core
1818

1919
import (
20-
"flag"
21-
"fmt"
22-
"runtime"
23-
"strings"
24-
2520
"github.com/op/go-logging"
2621
"github.com/spf13/viper"
2722
)
2823

29-
// Config the config wrapper structure
30-
type Config struct {
31-
}
32-
33-
func init() {
34-
35-
}
36-
37-
// SetupTestLogging setup the logging during test execution
38-
func SetupTestLogging() {
39-
level, err := logging.LogLevel(viper.GetString("peer.logging.level"))
40-
if err == nil {
41-
// No error, use the setting
42-
logging.SetLevel(level, "main")
43-
logging.SetLevel(level, "server")
44-
logging.SetLevel(level, "peer")
45-
} else {
46-
log.Warningf("Log level not recognized '%s', defaulting to %s: %s", viper.GetString("peer.logging.level"), logging.ERROR, err)
47-
logging.SetLevel(logging.ERROR, "main")
48-
logging.SetLevel(logging.ERROR, "server")
49-
logging.SetLevel(logging.ERROR, "peer")
50-
}
51-
}
52-
53-
// SetupTestConfig setup the config during test execution
54-
func SetupTestConfig() {
55-
flag.Parse()
56-
57-
// Now set the configuration file
58-
viper.SetEnvPrefix("HYPERLEDGER")
59-
viper.AutomaticEnv()
60-
replacer := strings.NewReplacer(".", "_")
61-
viper.SetEnvKeyReplacer(replacer)
62-
viper.SetConfigName("core") // name of config file (without extension)
63-
viper.AddConfigPath("./") // path to look for the config file in
64-
viper.AddConfigPath("./../") // path to look for the config file in
65-
err := viper.ReadInConfig() // Find and read the config file
66-
if err != nil { // Handle errors reading the config file
67-
panic(fmt.Errorf("Fatal error config file: %s \n", err))
68-
}
69-
70-
SetupTestLogging()
71-
72-
// Set the number of maxprocs
73-
var numProcsDesired = viper.GetInt("peer.gomaxprocs")
74-
log.Debugf("setting Number of procs to %d, was %d\n", numProcsDesired, runtime.GOMAXPROCS(2))
75-
76-
}
77-
7824
// See fabric/core/peer/config.go for comments on the configuration caching
7925
// methodology.
8026

0 commit comments

Comments
 (0)