예제 #1
0
func ExampleConfig_Loads() {
	c := core.NewConfig()

	//if err := c.Loads("config.json"); err != nil {
	//    panic(err)
	//}

	fmt.Println("listen at", c.Listen)
	fmt.Println("workers is", c.Workers)
	fmt.Println("go gc every", c.Go.GcInterval, "seconds")

	// Output:
	// listen at 1935
	// workers is 0
	// go gc every 300 seconds
}
예제 #2
0
func ExampleConfig_Loads() {
	c := core.NewConfig()

	//if err := c.Loads("config.json"); err != nil {
	//    panic(err)
	//}

	fmt.Println("listen at", c.Listen)
	fmt.Println("workers is", c.Workers)
	if c.Go.GcInterval == 0 {
		fmt.Println("go gc use default interval.")
	}

	// Output:
	// listen at 1935
	// workers is 0
	// go gc use default interval.
}