Giter Club home page Giter Club logo

Comments (5)

denniswon avatar denniswon commented on July 29, 2024

I am having the same issue. no workaround here?

from go-pry.

kofj avatar kofj commented on July 29, 2024

same question too.

from go-pry.

stevebaros avatar stevebaros commented on July 29, 2024

Is this project dead ?

from go-pry.

d4l3k avatar d4l3k commented on July 29, 2024

Unfortunately go modules aren't well supported by the standard library. Most of the modules/vendor implementation seems to be located in cmd/go and not exported as a usable library unlike the previous code.

As a work around you can use GO111MODULE=off to disable modules.

I haven't had a ton of time to dig into better support for this, PRs / suggestions on how to support modules cleanly are welcome :)

from go-pry.

d4l3k avatar d4l3k commented on July 29, 2024

Took another pass at this and it's now working.

⋊> ~/D/just-go go mod init github.com/d4l3k/just-go                                                                                                 00:10:06
go: creating new go.mod: module github.com/d4l3k/just-go
go: to add module requirements and sums:
	go mod tidy
⋊> ~/D/just-go go mod tidy                                                                                                                          00:10:11
go: finding module for package github.com/d4l3k/go-pry/pry
go: found github.com/d4l3k/go-pry/pry in github.com/d4l3k/go-pry v0.0.0-20210726070227-12ce9461a069
⋊> ~/D/just-go go-pry -d run .                                                                                                                      00:10:15
2021/07/26 00:10:22 generate.go:40: Prying into /home/rice/Developer/just-go/main.go
...
2021/07/26 00:10:22 generate.go:40:  :: Found 1 pry statements.
starting debug....

From /home/rice/Developer/just-go/main.go @ line 11 :

     6:   "github.com/d4l3k/go-pry/pry"
     7: )
     8:
     9: func main() {
    10:   fmt.Println("starting debug....")
 => 11:   pry.Pry()
    12: }
    13:

[81] go-pry> fmt.Sprintf("asdf %d", 10)
=> "asdf 10"
[82] go-pry> exit
Reverting files
⋊> ~/D/just-go ls                                                                                                                                   00:10:35
go.mod  go.sum  main.go
⋊> ~/D/just-go cat main.go                                                                                                                          00:10:39
package main

import (
	"fmt"

	"github.com/d4l3k/go-pry/pry"
)

func main() {
	fmt.Println("starting debug....")
	pry.Pry()
}

I had previously missed the fact that https://pkg.go.dev/golang.org/x/tools/go/packages exists. The old importer/build packages no longer wok and there's a new one instead. Switching to that resolved most of the issues w/ some work arounds on top.

from go-pry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.