code: func groupToGid(group string) (int, error) {
  	if group == "" {
  		return os.Getgid(), nil
  	}
  
  	var (
  		err error
  		id  int
  	)
  
  	// Try and parse as a number, if the error is ErrSyntax
  	// (i.e. its not a number) then we carry on and try it as a
  	// name.
  	if id, err = strconv.Atoi(group); err == nil {
  		return id, nil
  	} else if err.(*strconv.NumError).Err != strconv.ErrSyntax {
  		return 0, err
  	}
  
  	ginfo, err := user.LookupGroup(group)
  	if err != nil {
  		return 0, err
  	}
  	group = ginfo.Gid
  
  	if id, err = strconv.Atoi(group); err != nil {
  		return 0, err
  	}
  
  	return id, nil
  }
docs: // Convert a string containing either a group name or a stringified gid into a numeric id)