Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix wrong parameter order #1270

Merged
merged 1 commit into from
Sep 25, 2024
Merged

Conversation

cuishuang
Copy link
Contributor

@cuishuang cuishuang commented Sep 18, 2024

There is an example:

package main

import (
	"fmt"
	"strings"
)

func main() {

	cmd := struct {
		InstallScript string
	}{
		InstallScript: "./example/script.sh",
	}

	commandOld := "./" + strings.TrimPrefix("./", cmd.InstallScript)
	fmt.Println("old Constructed command:", commandOld)

	commandNew := "./" + strings.TrimPrefix(cmd.InstallScript, "./")
	fmt.Println("new Constructed command:", commandNew)
}

Output:

old Constructed command: ././
new Constructed command: ./example/script.sh

https://go.dev/play/p/OpHgx2LHtsp

Copy link
Member

@pascalbreuninger pascalbreuninger left a comment

Choose a reason for hiding this comment

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

LGTM, thanks 🙌

@pascalbreuninger pascalbreuninger merged commit a209e14 into loft-sh:main Sep 25, 2024
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.

2 participants