code: func Create(agentConf *Config, conf *serf.Config, logOutput io.Writer) (*Agent, error) {
  	// Ensure we have a log sink
  	if logOutput == nil {
  		logOutput = os.Stderr
  	}
  
  	// Setup the underlying loggers
  	conf.MemberlistConfig.LogOutput = logOutput
  	conf.MemberlistConfig.EnableCompression = agentConf.EnableCompression
  	conf.LogOutput = logOutput
  
  	// Create a channel to listen for events from Serf
  	eventCh := make(chan serf.Event, 64)
  	conf.EventCh = eventCh
  
  	// Setup the agent
  	agent := &Agent{
  		conf:          conf,
  		agentConf:     agentConf,
  		eventCh:       eventCh,
  		eventHandlers: make(map[EventHandler]struct{}),
  		logger:        log.New(logOutput, "", log.LstdFlags),
  		shutdownCh:    make(chan struct{}),
  	}
  
  	// Restore agent tags from a tags file
  	if agentConf.TagsFile != "" {
  		if err := agent.loadTagsFile(agentConf.TagsFile); err != nil {
  			return nil, err
  		}
  	}
  
  	// Load in a keyring file if provided
  	if agentConf.KeyringFile != "" {
  		if err := agent.loadKeyringFile(agentConf.KeyringFile); err != nil {
  			return nil, err
  		}
  	}
  
  	return agent, nil
  }
docs: // Start creates a new agent, potentially returning an error