Go (Golang) Tutorial #11 - Package Scope

preview_player
Показать описание
In this Golang tutorial we'll take a look at the scope of variables in functions in your Go projects.

🐱‍👤 View this course in full without ads on Net Ninja Pro:

🐱‍💻 Course Files:

🐱‍👤 JOIN THE YOUTUBE NET NINJA GANG -

🐱‍💻 🐱‍💻 My Udemy Courses:

🐱‍💻 Useful playlists:

🐱‍💻 Social Links:
Рекомендации по теме
Комментарии
Автор

This is the only tutorial that I'm subscribed because many tutorials on youtube are kind of outdated especially with go modules & package scope. you follow a tutorial and you might have a problem dealing with an error that is not found on older tutorials
I'd like to know more about Go's style guide that enforce me to do best practices as well as understand more.

vinceramces
Автор

As middle golang learning but I will add little I've learned go packages takes little to understand but for easygoing Go has package rule (Go Module) and public or functions, For now to make Export Type just capitalize first Letter now you can call out side of this package.

var, cons, Array, channels, functions and Interfaces are all types, in Golang every thing is type

pss_crs
Автор

Thank you so much . I was hard stuck at this problem for a while.🙏

mr.k
Автор

I think it's a nice feature in Go but the errors in the IDE and running many files at once makes it tedious to use the package system. I guess Shaun will make a video on making it better 👍

MaxProgramming
Автор

Hi from today onwards I planned to follow this series about go lang, and can you please clarify below questions plz
1) can we make Games(3D) using golang ?
2)Go vs Rust
&
3) Can I make operating system using go lang???

parthipankalayini
Автор

I instantly like any video of Ninja I see)
P.S. Being subscribed since the time there were 100k subscribers)

fraudinside
Автор

And what about importing different packages (not named "main"), especially those existing in the same folder as main.go file? It's not that simple as writing import "nameOfCustomPackage".

piotrrybka
Автор

I have had a bear of a time understanding how to get this to work with the files in separate subdirectories in the same directory. Any tips? Scoured the internet and haven't seen anything definitive that worked.

leootp
Автор

What if I want to make 20+ external helper function files? It would be awkward to type there names in command line! isn't it?!

tholfikarmohammed
Автор

The package system is the reason I never got into Golang...
This and the go get tool...
And the naming enforcement...
And the vile syntax

ionitaa
Автор

what if you have a lots files of go lang? are you gonna write down all file name or what?

jepqmw
Автор

I thought the whole point of code splitting is to not have crap like that, but instead have the files isolated and only expose the structures that need to be exposed

Rundik
Автор

I read somewhere if you want to run multiple file better use `go run .`
which method is better `go run .` or `go run main.go greeting.go`

xali