hyperbahn/client.go
func parseConfig(config *Configuration) error {
	if config.InitialNodesFile != "" {
		f, err := os.Open(config.InitialNodesFile)
		if err != nil {
			return err
		}
		defer f.Close()

		decoder := json.NewDecoder(f)
		if err := decoder.Decode(&config.InitialNodes); err != nil {
			return err
		}
	}

	if len(config.InitialNodes) == 0 {
		return fmt.Errorf("hyperbahn Client requires at least one initial node")
	}

	for _, node := range config.InitialNodes {
		if _, _, err := net.SplitHostPort(node); err != nil {
			return fmt.Errorf("hyperbahn Client got invalid node %v: %v", node, err)
		}
	}

	return nil
}
func parseConfig(config *Configuration) error {
	if config.InitialNodesFile != "" {
		f, err := os.Open(config.InitialNodesFile)
		if err != nil {
			return err
		}
		defer f.Close()

		decoder := json.NewDecoder(f)
		if err := decoder.Decode(&config.InitialNodes); err != nil {
			return err
		}
	}

	if len(config.InitialNodes) == 0 {
		return fmt.Errorf("hyperbahn Client requires at least one initial node")
	}

	for _, node := range config.InitialNodes {
		if _, _, err := net.SplitHostPort(node); err != nil {
			return fmt.Errorf("hyperbahn Client got invalid node %v: %v", node, err)
		}
	}

	return nil
}
// parseConfig parses the configuration options (e.g. InitialNodesFile)