Comments (4)
I have run into this problem myself. Here is the solution I've found:
go test -c -o myTest
- VS Code > Run and Debug > create a
launch.json
file > "Go" from drop down menu > Go: Launch Package - Inside
.vscode/launch.json
, update as"name": "My Test"
,"mode": "exec"
and"program": "./myTest"
- You can give
-test.run regex
argument to./myTest
to run specific test(s) - Run and Debug > Green play button will run/debug
./myTest
I dont really know why compiling the test exec first works.
Cheers..
from sorty.
Thanks!! :)
from sorty.
Same issue in GoLand (2023.3.2) and Go 1.21.6 where you cannot change mode to exec
.
Workaround is to use Attach to Process with time.Sleep()
but it's requires additional setup and not very straightforward.
package somepackage
import (
"github.com/mariotoffia/goannoy/builder"
"testing"
"time"
)
func Test_IncludeGoAnnoy(t *testing.T) {
builder := builder.Index[float32, uint32]().
AngularDistance(255).
UseMultiWorkerPolicy().
MmapIndexAllocator().
Build()
time.Sleep(time.Second * 15) // set time
builder.Close() // set breakpoint
}
- Set time, run test as usual (not debugging).
- Invoke Run | Attach to Process in the main menu.
- Select a test process (not go test or test2json)
@jfcg Could you please take a look? It seems that -gcflags all=-N -l
+ //go:nosplit
directive causes this issue in 1.19.* and lower: golang/go#54291
from sorty.
Hi,
For sorty
's core use case, removing stack check & preventing preemption (especially at leaf functions) are important for performance. So go:nosplit
directives need to stay. There is a solution working for VSCode, so maybe you could consider
- adding
"mode": "exec"
launch configuration to GoLand IDE (mid to long term) - vendoring
sorty
and removing somego:nosplit
s for getting past your debug compilation errors (short term)
Cheers..
from sorty.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sorty.