func init() {
	// println("+ circuit/load/config ……")
	// defer println("+ circuit/load/config ok")

	// Seed random number generation
	rand.Seed(time.Now().UnixNano())
	log.SetFlags(log.LstdFlags | log.Llongfile)

	DefaultSpark = &SparkConfig{
		ID:       n.ChooseWorkerID(),
		BindAddr: "",         // Don't accept incoming circuit calls from other workers
		Host:     "",         // "
		Anchor:   []string{}, // Don't register within the anchor file system
	}

	Config = &WorkerConfig{}
	Role = os.Getenv(RoleEnv)
	if Role == "" {
		Role = Main
	}
	switch Role {
	case Main:
		readAsMain()
	case Daemonizer:
		fmt.Print(XXX_shell_barrier)
		readAsDaemonizerOrWorker()
	case Worker:
		readAsDaemonizerOrWorker()
	default:
		log.Printf("Circuit role '%s' not recognized\n", Role)
		os.Exit(1)
	}
	if Config.Spark == nil {
		Config.Spark = DefaultSpark
	}
}
// init determines in what context we are being run and reads the configurations accordingly
init determines in what context we are being run and reads the configurations accordingly
// init determines in what context we are being run and reads the configurations accordingly
func init() {
	rand.Seed(time.Now().UnixNano())
	log.SetFlags(log.LstdFlags | log.Llongfile)
	DefaultSpark = &SparkConfig{
		ID:       n.ChooseWorkerID(),
		BindAddr: "",         
		Host:     "",         
		Anchor:   []string{}, 
	}
	Config = &WorkerConfig{}
	Role = os.Getenv(RoleEnv)
	if Role == "" {
		Role = Main
	}
	switch Role {
	case Main:
		readAsMain()
	case Daemonizer:
		fmt.Print(XXX_shell_barrier)
		readAsDaemonizerOrWorker()
	case Worker:
		readAsDaemonizerOrWorker()
	default:
		log.Printf("Circuit role '%s' not recognized\n", Role)
		os.Exit(1)
	}
	if Config.Spark == nil {
		Config.Spark = DefaultSpark
	}
}
func init ( ) { rand . Seed ( time . Now ( ) . UnixNano ( ) ) log . SetFlags ( log . LstdFlags | log . Llongfile ) DefaultSpark = & SparkConfig { ID : n . ChooseWorkerID ( ) , BindAddr : " " , Host : " " , Anchor : [ ] string { } , } Config = & WorkerConfig { } Role = os . Getenv ( RoleEnv ) if Role == " " { Role = Main } switch Role { case Main : readAsMain ( ) case Daemonizer : fmt . Print ( XXX_shell_barrier ) readAsDaemonizerOrWorker ( ) case Worker : readAsDaemonizerOrWorker ( ) default : log . Printf ( " \n " , Role ) os . Exit ( 1 ) } if Config . Spark == nil { Config . Spark = DefaultSpark } }
init determines in what context we are being run and reads the configurations accordingly
init determines in what context we are being run and reads the configurations accordingly
// println("+ circuit/load/config ……") // defer println("+ circuit/load/config ok") // Seed random number generation // Don't accept incoming circuit calls from other workers // " // Don't register within the anchor file system