Go 1.16 Embeded Files Tutorial - BETA Feature

  Рет қаралды 8,163

TutorialEdge

TutorialEdge

3 жыл бұрын

👨‍💻 For the price of a ☕ every month, sign up and gain access to a growing list of premium courses on my site - tutorialedge.net/pricing/
✅ Subscribe and hit that 🔔 to get notified for all the latest tutorials!
Draft - github.com/golang/go/issues/4...
🤓 / elliot_f
‎💻 tutorialedge.net
❤️ / tutorialedge

Пікірлер: 23
@tomontheinternet
@tomontheinternet 3 жыл бұрын
Awesome video. Helped me a lot. ⚠️You cannot "go:embed" inside functions anymore. This was removed. You need to do it at the package scope now. Hopefully this helps someone!
@markuswerner1166
@markuswerner1166 3 жыл бұрын
Simply Thank you
@Vokcholok
@Vokcholok 3 жыл бұрын
Cool feature and nice tutorial. Thanks a lot.
@james.schubert
@james.schubert 3 жыл бұрын
I enjoyed this tutorial.
@catalinim4227
@catalinim4227 3 жыл бұрын
//go:embed goes outside the function, but this is good stuff
@dv8_1808
@dv8_1808 3 жыл бұрын
Pretty cool stuff. How does embedded binary files work? Also the mic audio is warmer not so hollow. Sounds good
@Tutorialedge
@Tutorialedge 3 жыл бұрын
So from what I understand, the contents of the file are wrapped up in the compiled binary that is generated when you run your go build ./... command. This means that everything your application needs to effectively work with that file is encapsulated in the binary itself. Also, thanks for the feedback on the audio! I'm delighted with how it sounds with minimal to now post-processing!
@barjo_
@barjo_ 3 жыл бұрын
It's the same as simply creating a string variable storing the content of the file. That's all. So the content of the file is stored within the program itself, which is compiled into a single binary. This is opposed to writing a program which reads from a file at runtime, meaning when you relocate the binary (uploading it to a server for example), you must move those files being read as well. Embedding the files into the binary means all you need to move is the binary itself. Something to bear in mind is that the state of the files being embedded will be as they were when the program was compiled. And also, embedding lots of files will result in a large binary size.
@jamieallen8867
@jamieallen8867 3 жыл бұрын
You prolly dont care but if you guys are bored like me atm then you can watch pretty much all the latest movies and series on Instaflixxer. Have been streaming with my girlfriend during the lockdown :)
@quincyjaxon2105
@quincyjaxon2105 3 жыл бұрын
@Jamie Allen Yup, have been watching on Instaflixxer for years myself :D
@kyubum
@kyubum 3 жыл бұрын
goood
@motazabdelazeem3533
@motazabdelazeem3533 3 жыл бұрын
1:30 print(s) without reading it from file is confusing, I thought you would read it as any external file, how to distinguish between multiple files?
@giuseppecv56
@giuseppecv56 3 жыл бұрын
Hi, nice video, thanks for that. I have a question, how do you manage several versions of go in windows? I have tried but I cannot execute the other version :(
@Tutorialedge
@Tutorialedge 3 жыл бұрын
I don't use Go, but one approach you could use is to wrap your application in a docker container and pin the Go version you want to use within that. It keeps your machine nice and tidy without a million Go binaries on your path and allows you to develop apps that may be reliant on different versions at the same time without wasting time constantly updating your environment variables!
@giuseppecv56
@giuseppecv56 3 жыл бұрын
Wow, thanks for that, is a great idea.
@oussamasethoum2755
@oussamasethoum2755 Жыл бұрын
Is there a way to read the content of the embed Fs folder without serving it with http server.
@eamarc
@eamarc 3 жыл бұрын
go:embed cannot apply to var inside func
@EshanKaley
@EshanKaley 3 жыл бұрын
you can only use it over package level variables
@venturelee9649
@venturelee9649 3 жыл бұрын
i like this vscode theme, may i know what it is?
@Tutorialedge
@Tutorialedge 3 жыл бұрын
Hi! It's Wes Bos' Cobalt2 theme!
@nasermirzaei89
@nasermirzaei89 3 жыл бұрын
I think Go is going to be magical, like ruby and other stuff!!! 😞
@Tutorialedge
@Tutorialedge 3 жыл бұрын
I'm not sure I'm a fan of certain directions the language is going in, but I can certainly see why they've incorporated these functions into the language. They are adding very opinionated ways of solving problems into the language which should hopefully ensure that the code for these systems remains as readable as possible.
@nitroflap
@nitroflap 3 жыл бұрын
WHAT?????
Getting Started with Docker Compose For Go Applications
9:48
TutorialEdge
Рет қаралды 19 М.
Golang Channels Or Wait Groups? Let Me Explain.
18:32
Anthony GG
Рет қаралды 20 М.
Каха заблудился в горах
00:57
К-Media
Рет қаралды 9 МЛН
Smart Sigma Kid #funny #sigma #comedy
00:40
CRAZY GREAPA
Рет қаралды 22 МЛН
DAD LEFT HIS OLD SOCKS ON THE COUCH…😱😂
00:24
JULI_PROETO
Рет қаралды 17 МЛН
Understanding Contexts in Go in 5(-ish?) Minutes
15:14
TutorialEdge
Рет қаралды 60 М.
Getting Started with Generics in Go
13:12
TutorialEdge
Рет қаралды 27 М.
THIS is the BEST Way to Write HTTP Services in Golang
13:53
Go 1.16 Embed package explained in 5 minutes!
5:13
Mathis Van Eetvelde
Рет қаралды 7 М.
//go:embed draft design
16:08
Russ Cox
Рет қаралды 9 М.
an 8-bit microcontroller but it has a garbage collector
4:05
Low Level Learning
Рет қаралды 67 М.
Everything You Need To Know About unsafe.Pointer In Golang
12:00
Go Error Handling Best Practices & Advanced Tips
6:49
Golang Dojo
Рет қаралды 36 М.
Go Mutex Tutorial
8:57
TutorialEdge
Рет қаралды 21 М.
Каха заблудился в горах
00:57
К-Media
Рет қаралды 9 МЛН