Skip to content

go install -ldflags="options" works in 0.94.0 but not in 0.94.1, 0.94.2 #13066

@doongjohn

Description

@doongjohn

Describe the bug

I used this line of code to install https://github.com/gokcehan/lf however it doesn't work anymore.

with-env {CGO_ENABLED: 0} { go install -ldflags="-s -w" github.com/gokcehan/lf@latest }

How to reproduce

  1. use version 0.94.1 or 0.94.2
  2. run command: with-env {CGO_ENABLED: 0} { go install -ldflags="-s -w" github.com/gokcehan/lf@latest }
  3. error
❯ with-env {CGO_ENABLED: 0} { go install -ldflags="-s -w" github.com/gokcehan/lf@latest }
invalid value "\"-s -w\"" for flag -ldflags: missing =<value> in <pattern>=<value>
usage: go install [build flags] [packages]
Run 'go help install' for details.

using a single quote doesn't help

❯ with-env {CGO_ENABLED: 0} { go install -ldflags='-s -w' github.com/gokcehan/lf@latest }
invalid value "'-s -w'" for flag -ldflags: missing =<value> in <pattern>=<value>
usage: go install [build flags] [packages]
Run 'go help install' for details.

Expected behavior

-ldflags="-s -w" should work.

Screenshots

No response

Configuration

key value
version 0.94.2
major 0
minor 94
patch 2
branch
commit_hash be8c1dc
build_os windows-x86_64
build_target x86_64-pc-windows-msvc
rust_version rustc 1.77.2 (25ef9e3d8 2024-04-09)
rust_channel 1.77.2-x86_64-pc-windows-msvc
cargo_version cargo 1.77.2 (e52e36006 2024-03-26)
build_time 2024-06-03 19:27:48 +00:00
build_rust_channel release
allocator mimalloc
features default, sqlite, system-clipboard, trash, which
installed_plugins

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    category:regressionSomething that worked does not work anymore.status:needs-triageAn issue that hasn't had any proper look

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions