protected RunnerAndConfigurationSettings createConfigurationByElement(
      Location location, ConfigurationContext context) {

    GoFile goFile = locationToFile(location);

    if (goFile == null) return null;

    if (goFile.getMainFunction() == null) {
      return null;
    }

    return createConfiguration(goFile, context.getModule());
  }
  public GoFileMetadata(GoFile file) {
    packageName = file.getPackage().getPackageName();
    main = file.getMainFunction() != null;

    imports = new ArrayList<String>();

    GoImportDeclarations[] importDeclarations = file.getImportDeclarations();

    for (GoImportDeclarations importDeclaration : importDeclarations) {
      GoImportDeclaration[] importSpecs = importDeclaration.getDeclarations();

      for (GoImportDeclaration importSpec : importSpecs) {
        imports.add(importSpec.getImportPath());
      }
    }
  }