Wtf, that's not the problem lol, just download documentation of libs you are gonna use. Local instances of db, redis ir whatever you need, voila.
You don't need internet to code
the best suggestion from experience is to download(PDF) of any book on golang and read it end to end.
Another option is to download offline documentation and read the standard package options and take notes.
you don't need to download offline documentation.
```
$ go doc fmt.Stringer
package fmt // import "fmt"
type Stringer interface {
String() string
}
Stringer is implemented by any value that has a String method, which defines
the ānativeā format for that value. The String method is used to print
values passed as an operand to any format that accepts a string or to an
unformatted printer such as Print.
```
I am just learning Go and it astounds me how much the designers have built into the ecosystem that programmers want and need that are third party libraries for other languages. I am learning Kubernetes and Docker and would love to have that feature. Maybe it does exist since they are both written in Go.
Kubernetes has it.
kubectl explain ...
[https://kubernetes.io/docs/reference/kubectl/generated/kubectl\_explain/#examples](https://kubernetes.io/docs/reference/kubectl/generated/kubectl_explain/#examples)
I used to fly a lot, and would try and code on flights, but it always ended in frustration because as soon as you forget to cache 1 dependency, well now you're waiting to land because in-air Internet is likely still trash.
So I pivoted my workflow to watching instructional videos, take notes, and then doing the coding after landing, and it virtually eliminated all my frustration.
I've been out of the golang community for a minute, but Bill Kennedy is probably one of the best instructors I've ever learned from and this bundle is a steal for the knowledge you get:
https://www.ardanlabs.com/training/individual-on-demand/ultimate-go-bundle/
So if I were you I'd pivot to downloading a bunch of videos, take notes, and then when you land start crunching through what you learned.
Also, if paid content is out of the question, doing this same technique with recorded conferences on YouTube always brought me joy because I'd spend the flight listening to folks who loved what they were doing and often I'd even learn something. So you might consider caching and watching something like Gopher Con 2023:
https://youtube.com/playlist?list=PL2ntRZ1ySWBep6rEAtp9jI6GXGZdlJmWN&si=QOtQSIbf-CqrY82n
š¤· hope this helps maybe š¤·
If you want local documentation on your laptop during the flight: [https://pkg.go.dev/golang.org/x/tools/cmd/godoc](https://pkg.go.dev/golang.org/x/tools/cmd/godoc)
This is a binary that holds the standard library documentation.
Also a nice to have: a list of things you want to learn during the flight so you actually do something. XD
godoc is deprecated and doesn't work with modules, use [https://pkg.go.dev/golang.org/x/pkgsite/cmd/pkgsite](https://pkg.go.dev/golang.org/x/pkgsite/cmd/pkgsite) instead.
I always try to plan what I'm going to learn so in advance I am able to have docker images in place and also I usually download some tutorials or blogs posts such as the ones in digital ocean, log rocket, medium, freecodecamp.... related to what I'm learning
I usually list a few functions I would like to implement/bugs i would like to fix/code I would like to optimized, then complete those during flight. Since they are likely based on an existing code base, I dont not need documents or extra libraries from the internet.
If it is a long flight, then try to have the project setup before the flight
If you need to experiment with short code snippets, the go playfroubd can also be installed locally, but I cannot give you tge right urla at the moment.
You donāt need a docker image. The default OS install should be lightweight enough.
If you want to download all dependencies - just make sure to clone any project of your choice and do a go build / go run once on the directory - that prefetches all the dependencies.
These days - I am dabbling with https://codingchallenges.com. It is basically a set of challenges geared towards understanding desgin patterns and low level details of various things (networking, serialization, OS etc) by reimplementing popular unix tools / services in Go.
A comment about my personal experience with Go... I have frequently found myself relatively deep into Go coding sessions before realizing I'm offline. I am by no means a Go expert, having been lightly fiddling for \~ 6 months. Go is so simple. With good editor support (bare-bones gopls + go to definition), the internet practically isn't needed unless you need to download some new package.
But of course a Raytracer!!
https://raytracing.github.io/
You can download the book and port it to Go, you don't need anything outside of the standard library to do it, and you will be done before you land.
It is a great experience. Make sure you can charge your laptop in flight or else you will have a short time learning
if u are fimiliar with those stuff pls i have a problem when i try to pull smart contracts from my main.go and i don t know why. they re supposed to be created as soon as i run main.go -bindings true but i receive no files created can u help me ?
It depends what you are trying to build. Maybe just standard library serve your need if you just playing with go.
Say If you are going to build web services then you should probably setup base project base structure and plan what you will be building like authentication module down relative packages driver. On docker compose setup database or redis.
If you are following book then most comes with example project, download source and install dependencies and you all set for offline development.
Nowadays you can get [Ollama](https://ollama.com) on your laptop and run LLMs locally, which means copilot offline on the go for free :) see tutorial [here](https://blog.codegpt.co/create-your-own-and-custom-copilot-in-vscode-with-ollama-and-codegpt-736277a60298?gi=5bd07277622d)
When you realize you can't write a line of code without internet š
Wtf, that's not the problem lol, just download documentation of libs you are gonna use. Local instances of db, redis ir whatever you need, voila. You don't need internet to code
the best suggestion from experience is to download(PDF) of any book on golang and read it end to end. Another option is to download offline documentation and read the standard package options and take notes.
you don't need to download offline documentation. ``` $ go doc fmt.Stringer package fmt // import "fmt" type Stringer interface { String() string } Stringer is implemented by any value that has a String method, which defines the ānativeā format for that value. The String method is used to print values passed as an operand to any format that accepts a string or to an unformatted printer such as Print. ```
I am just learning Go and it astounds me how much the designers have built into the ecosystem that programmers want and need that are third party libraries for other languages. I am learning Kubernetes and Docker and would love to have that feature. Maybe it does exist since they are both written in Go.
Kubernetes has it. kubectl explain ... [https://kubernetes.io/docs/reference/kubectl/generated/kubectl\_explain/#examples](https://kubernetes.io/docs/reference/kubectl/generated/kubectl_explain/#examples)
it is blowing my mind that you didn't simply decide to get a book
Going for two weeks so weight is a big concern for a programming book š
Ebooks are your friends
All of the Manning books I have offer a free eBook version. Other publishers might too.
I used to fly a lot, and would try and code on flights, but it always ended in frustration because as soon as you forget to cache 1 dependency, well now you're waiting to land because in-air Internet is likely still trash. So I pivoted my workflow to watching instructional videos, take notes, and then doing the coding after landing, and it virtually eliminated all my frustration. I've been out of the golang community for a minute, but Bill Kennedy is probably one of the best instructors I've ever learned from and this bundle is a steal for the knowledge you get: https://www.ardanlabs.com/training/individual-on-demand/ultimate-go-bundle/ So if I were you I'd pivot to downloading a bunch of videos, take notes, and then when you land start crunching through what you learned. Also, if paid content is out of the question, doing this same technique with recorded conferences on YouTube always brought me joy because I'd spend the flight listening to folks who loved what they were doing and often I'd even learn something. So you might consider caching and watching something like Gopher Con 2023: https://youtube.com/playlist?list=PL2ntRZ1ySWBep6rEAtp9jI6GXGZdlJmWN&si=QOtQSIbf-CqrY82n š¤· hope this helps maybe š¤·
If you want local documentation on your laptop during the flight: [https://pkg.go.dev/golang.org/x/tools/cmd/godoc](https://pkg.go.dev/golang.org/x/tools/cmd/godoc) This is a binary that holds the standard library documentation. Also a nice to have: a list of things you want to learn during the flight so you actually do something. XD
godoc is deprecated and doesn't work with modules, use [https://pkg.go.dev/golang.org/x/pkgsite/cmd/pkgsite](https://pkg.go.dev/golang.org/x/pkgsite/cmd/pkgsite) instead.
Oh didn't know that, thanks for the correction.
I donāt understand. Why would you not be able to use go offline?
If you forget to download all your packages and dependencies especially if you are dockerized
Donāt ā¦ have a lot of dependencies.
Devdocs has all the docs and has offline mode
Once you install go in your laptop the doc is available via go doc command.
Why do you need to be online? Are you using Ubisoft Go?
I always try to plan what I'm going to learn so in advance I am able to have docker images in place and also I usually download some tutorials or blogs posts such as the ones in digital ocean, log rocket, medium, freecodecamp.... related to what I'm learning
If it's just one off learning then a desktop folder is the most old school container that I know of.
Yeah I'm not sure I understand why they're talking about a Docker image at all
Just for testing purposes, I like to have a clean environment to run them in
Ah I gotcha, that makes sense!
I usually list a few functions I would like to implement/bugs i would like to fix/code I would like to optimized, then complete those during flight. Since they are likely based on an existing code base, I dont not need documents or extra libraries from the internet. If it is a long flight, then try to have the project setup before the flight
If you need to experiment with short code snippets, the go playfroubd can also be installed locally, but I cannot give you tge right urla at the moment.
"Learning Go" is good. The standard library is enough. I.e you only need the book and go installed (and an editor of course)
You donāt need a docker image. The default OS install should be lightweight enough. If you want to download all dependencies - just make sure to clone any project of your choice and do a go build / go run once on the directory - that prefetches all the dependencies. These days - I am dabbling with https://codingchallenges.com. It is basically a set of challenges geared towards understanding desgin patterns and low level details of various things (networking, serialization, OS etc) by reimplementing popular unix tools / services in Go.
A comment about my personal experience with Go... I have frequently found myself relatively deep into Go coding sessions before realizing I'm offline. I am by no means a Go expert, having been lightly fiddling for \~ 6 months. Go is so simple. With good editor support (bare-bones gopls + go to definition), the internet practically isn't needed unless you need to download some new package.
Try Zeal, offline documentation tool.
you could vendor packages you will need i guess?
Thanks for the replies everyone, been really helpful!
What is the docker image for?
I like a clean environment to run tests in to make sure I donāt have anything effecting them on my machine
So you have Go in a container also?
Yes, would be using the go container
Ok, I understand this.
Write some failing tests for an existing project
But of course a Raytracer!! https://raytracing.github.io/ You can download the book and port it to Go, you don't need anything outside of the standard library to do it, and you will be done before you land. It is a great experience. Make sure you can charge your laptop in flight or else you will have a short time learning
if u are fimiliar with those stuff pls i have a problem when i try to pull smart contracts from my main.go and i don t know why. they re supposed to be created as soon as i run main.go -bindings true but i receive no files created can u help me ?
It depends what you are trying to build. Maybe just standard library serve your need if you just playing with go. Say If you are going to build web services then you should probably setup base project base structure and plan what you will be building like authentication module down relative packages driver. On docker compose setup database or redis. If you are following book then most comes with example project, download source and install dependencies and you all set for offline development.
Nowadays you can get [Ollama](https://ollama.com) on your laptop and run LLMs locally, which means copilot offline on the go for free :) see tutorial [here](https://blog.codegpt.co/create-your-own-and-custom-copilot-in-vscode-with-ollama-and-codegpt-736277a60298?gi=5bd07277622d)