in dubbo-go-triple-server/main.go [52:75]
func main() {
var (
err error
)
flag.Float64Var(&timeoutRatio, "tr", defaultTimeoutRatio, "The percentage of timeouts. If greater than 0 there will be a timeout for that percentage of requests with a timeout of `timeout`")
flag.StringVar(&timeoutDurationStr, "t", defaultTimeoutDuration, "Duration of timeout. It should be a string representing a time, like \"1h\", \"30m\", etc")
flag.Parse()
if timeoutRatio > 1 || timeoutRatio < 0 {
panic(fmt.Errorf("Timeout Ratio should be a decimal between 0 and 1 "))
}
timeoutDuration, err = time.ParseDuration(timeoutDurationStr)
if err != nil {
panic(fmt.Errorf("timeout duration should be a string representing a time, like \"1h\", \"30m\", etc"))
}
config.SetProviderService(&Provider{})
if err = config.Load(); err != nil {
panic(err)
}
select {}
}