constructor()

in src/targets/go.ts [127:152]


  constructor(props: GoReleaserProps) {

    if (!shell.which('git')) {
      throw new Error('git must be available to in order to be able to push Go code to GitHub');
    }

    this.version = props.version;
    this.gitCommitMessage = props.message;
    this.dir = path.resolve(props.dir ?? path.join(process.cwd(), 'dist', 'go'));
    this.gitBranch = props.branch ?? 'main';
    this.dryRun = props.dryRun ?? false;

    const gitUsername = props.username ?? git.username();
    const gitUseremail = props.email ?? git.email();

    if (!gitUsername) {
      throw new Error('Unable to detect username. either configure a git user.name or pass GIT_USER_NAME env variable');
    }

    if (!gitUseremail) {
      throw new Error('Unable to detect user email. either configure a git user.email or pass GIT_USER_EMAIL env variable');
    }

    this.gitUseremail = gitUseremail;
    this.gitUsername = gitUsername;
  }