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

bug: The code generated in {} will merge multiple lines of code into one line #1769

Closed
LiusCraft opened this issue Feb 22, 2024 · 2 comments
Closed
Labels

Comments

@LiusCraft
Copy link
Contributor

LiusCraft commented Feb 22, 2024

The following program sample.gop triggers an unexpected result

// add a sample

// Code generated by gop (Go+); DO NOT EDIT.

package main

import "fmt"

const _ = true

type aaa struct {
	ADwd string
}
//line b.gop:7
func main() {
//line b.gop:7:1
	fmt.Println(map[interface {}]string{"1": "", 2: "2"})
//line b.gop:8:1
	fmt.Println([]interface {}{1, "2", 3.2})
//line b.gop:15:1
	fmt.Println("wdsefsf")
}

Expected result

// Code generated by gop (Go+); DO NOT EDIT.

package main

import "fmt"

const _ = true

type aaa struct {
	ADwd string
}
//line b.gop:7
func main() {
//line b.gop:7:1
	fmt.Println(map[interface {}]string{"1": "", 2: "2"})
//line b.gop:8:1
	fmt.Println([]interface {}{
		1, 
		"2", 
		3.2
	})
//line b.gop:15:1
	fmt.Println("wdsefsf")
}

Got

$ gop run ./sample.gop
map[2:2 1:]
[1 2 3.2]
wdsefsf

Gop Version

gop v1.2.2 devel windows/amd64

Additional Notes

gop code:

package main

type aaa struct {
	ADwd string
}

println {"1": "", 2: "2"}
println [
	1,
	"2",
	3.2,
]

// fesfsef
println "wdsefsf"
@LiusCraft
Copy link
Contributor Author

This issue affects the ability of gop delve to accurately breakpoint to the specified line

@xushiwei xushiwei added the bug label Feb 22, 2024
@xushiwei
Copy link
Member

xushiwei commented Mar 8, 2024

#1791

@xushiwei xushiwei closed this as completed Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants