code: func ParseRedisInfo(s string) (*RedisInfo, error) {
  	var info RedisInfo
  
  	scanner := bufio.NewScanner(strings.NewReader(s))
  	for scanner.Scan() {
  		line := scanner.Text()
  
  		// Skip blank lines & comment lines
  		if strings.HasPrefix(line, "#") || line == "" {
  			continue
  		}
  
  		// Split into key/value.
  		a := strings.SplitN(line, ":", 2)
  		if len(a) < 2 {
  			continue
  		}
  		key, value := strings.TrimSpace(a[0]), strings.TrimSpace(a[1])
  
  		// Parse into appropriate field.
  		switch key {
  		case "role":
  			info.Role = value
  		case "master_host":
  			info.MasterHost = value
  		case "master_port":
  			info.MasterPort = atoi(value)
  		case "master_link_status":
  			info.MasterLinkStatus = value
  		case "master_last_io_seconds_ago":
  			info.MasterLastIO = time.Duration(atoi(value)) * time.Second
  		case "master_sync_in_progress":
  			info.MasterSyncInProgress = value == "1"
  		case "master_sync_left_bytes":
  			info.MasterSyncLeftBytes, _ = strconv.ParseInt(value, 10, 64)
  		case "master_sync_last_io_seconds_ago":
  			info.MasterSyncLastIO = time.Duration(atoi(value)) * time.Second
  		case "master_link_down_since_seconds":
  			info.MasterLinkDownSince = time.Duration(atoi(value)) * time.Second
  		case "connected_slaves":
  			info.ConnectedSlaves = atoi(value)
  		}
  	}
  
  	if err := scanner.Err(); err != nil {
  		return nil, err
  	}
  	return &info, nil
  }
docs: // ParseRedisInfo parses the response from an INFO command.