code: func writeKey(keyDir string, addr, keyJson []byte) ([]byte, error) {
  	dir, err := returnDataDir(keyDir)
  	if err != nil {
  		return nil, fmt.Errorf("Failed to get keys dir: %v", err)
  	}
  	if err := WriteKeyFile(addr, dir, keyJson); err != nil {
  		return nil, err
  	}
  	return addr, nil
  }
docs: //----------------------------------------------------------------