code: func relativePath(file, relativeTo string) string {
  	// stdin: return the current working directory if possible.
  	if relativeTo == "-" {
  		if cwd, err := os.Getwd(); err == nil {
  			return filepath.Join(cwd, file)
  		}
  	}
  
  	// If the given file is already an absolute path, just return it.
  	// Otherwise, the returned path will be relative to the given relativeTo
  	// path.
  	if filepath.IsAbs(file) {
  		return file
  	}
  
  	abs, err := filepath.Abs(filepath.Join(path.Dir(relativeTo), file))
  	if err != nil {
  		logrus.Errorf("Failed to get absolute directory: %s", err)
  		return file
  	}
  	return abs
  }
docs: // relativePath returns the proper relative path for the given file path. If
  // the relativeTo string equals "-", then it means that it's from the stdin,
  // and the returned path will be the current working directory. Otherwise, if
  // file is really an absolute path, then it will be returned without any
  // changes. Otherwise, the returned path will be a combination of relativeTo
  // and file.