Skip to content

Conversation

imrivera
Copy link

This changes allow build.sh to be used with Golang 1.20+

@Copilot Copilot AI review requested due to automatic review settings September 29, 2025 16:23
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the build script to support Golang versions 1.20 and above by modifying the version checking logic and conditionally handling the -i flag which was removed in newer Go versions.

  • Replaces hardcoded version regex with dynamic version parsing
  • Adds conditional logic to only use the -i flag for Go 1.16
  • Introduces a variable to conditionally apply build options based on Go version
Comments suppressed due to low confidence (1)

build.sh:1

  • The regex pattern assumes single-digit version numbers after 1. This will fail for Go versions like 1.20, 1.21, etc. The pattern should be go1\.\K[0-9]+ to match multiple digits correctly.
#!/bin/bash

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +82 to +83
if [[ "$GO_VERSION" -eq "16" ]]; then
# This option is needed only for go 1.16
Copy link
Preview

Copilot AI Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String comparison should be used instead of numeric comparison. Go version numbers like '20' and '21' are valid but this logic incorrectly assumes only Go 1.16 needs the -i flag. Based on Go release notes, the -i flag was deprecated and removed in Go 1.17+, so this condition should check for versions less than 17.

Suggested change
if [[ "$GO_VERSION" -eq "16" ]]; then
# This option is needed only for go 1.16
if [[ "$GO_VERSION" -lt "17" ]]; then
# This option is needed only for go versions less than 1.17

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant