x-motemen / gore

Yet another Go REPL that works nicely. Featured with line editing, code completion, and more.
MIT License
5.11k stars 148 forks source link

please support offline #219

Closed tigerinus closed 2 years ago

tigerinus commented 2 years ago

Had an internet outage today, then found that gore does not give a prompt.

Understood that there is difficulty supporting offline/cached packages (https://github.com/x-motemen/gore/pull/165), but is it possible to at least show the prompt and allow built-in and some basic packages?

My scenario is that I just need a REPL to try out some Go syntax which doesn't really need much packages besides fmt.

itchyny commented 2 years ago

I tested right now, and gore 0.5.5 works offline in my environment.

tigerinus commented 2 years ago

interesting... it doesn't repro again.

I simply pulled my cable - not sure if it's the same situation as internet outage (router works but ISP doesn't)

Does gore access network for anything during its startup?

itchyny commented 2 years ago

When gore cannot find the pretty printer package github.com/k0kubun/pp/v3 in local filesystem module cache ($(go env GOPATH)/pkg/mod), it checks connectivity to GOPROXY (default proxy.golang.org) with 5s timeout. If it fails, it uses the standard fmt package.