class GoPathContext {

  public String resolve(String filePath) {
    return resolvedPaths.computeIfAbsent(filePath, path -> {
      if (path.startsWith(LINUX_ABSOLUTE_PREFIX)) {
        return path.substring(1);
      } else if (path.startsWith(WINDOWS_ABSOLUTE_PREFIX)) {
        Matcher matcher = WINDOWS_ABSOLUTE_REGEX.matcher(path);
        if (matcher.find()) {
          matcher.reset();
          return matcher.replaceFirst("$1:\\\\");
        }
      }
      return prefixByFirstValidGoPath(path)
        .orElseGet(() -> prefixByFirstGoPath(path));
    });
  }

  public  GoPathContext(char fileSeparator, String pathSeparator, @Nullable String goPath);

}