final String configName = (new File(packageDir)).getName();
// Now add a new run configuration:
RunManager runManager = RunManager.getInstance(module.getProject());
GoApplicationConfigurationType goAppConfigType = new GoApplicationConfigurationType();
GoApplicationConfigurationType.GoFactory goConfigFactory = new GoApplicationConfigurationType.GoFactory(new GoApplicationConfigurationType());
GoApplicationConfiguration configuration = new GoApplicationConfiguration("name", module.getProject(), goAppConfigType);
configuration.runPackage = true;
configuration.packageDir = packageDir;
configuration.workingDir = module.getProject().getBasePath();
configuration.goOutputDir = module.getProject().getBasePath() + File.separatorChar + "bin";