Golang Rune - Fully Understanding Runes in Go

  Рет қаралды 21,012

Golang Dojo

Golang Dojo

Күн бұрын

Golang Rune - Fully Understanding Runes in Go -
In today's Golang tutorial video, we will talk about the basic runes in the Go/Golang programming language. We will go through the ASCII characters, UTF-8 in Go, and everything you need to know to fully understand how runes function in Golang. Enjoy!
--
Golang Dojo is all about becoming Golang Ninjas together. You can expect all kinds of Golang tutorials, news, tips & tricks, and my daily struggles as a Golang developer. Make sure to subscribe if you look forward to such content!
Get Your Golang Cheat Sheet! - golangdojo.com/cheatsheet
Git repos & notes - golangdojo.com/resources
Golang Explained - • Golang Rune - Fully Un...
--
Timestamps
0:00 Intro
0:33 ASCII characters
1:51 UTF-8
4:11 Single-byte characters
4:48 Multi-byte characters
5:17 Golang Runes
6:47 Strings and Bytes
10:15 Outro
--
#golang #goprogramming #golangdojo

Пікірлер: 37
@GolangDojo
@GolangDojo 3 жыл бұрын
📝Get your *FREE Golang Cheat Sheet* - golangdojo.com/cheatsheet
@adamrhea2339
@adamrhea2339 2 жыл бұрын
So basically a rune is a 4byte utf 8 encoding used as default when declaring a character or string. If you want to use something more efficient like ascii encoding that uses only one byte or 7 bits I think? you can use the byte function in golang and type the decimal number into represented by binary. for example, byte(65) which is 1000001 I'm binary which represents "A" in ascii. Here you have "A" used in your program with ascii encoding (using 3 less bytes) instead of using default rune which is 4 byte representation for that character "A"
@BlindWitchFire
@BlindWitchFire 3 жыл бұрын
Love to see Go _!_ I also picked up Flutter/Dart this past couple years for App Development on Mobile & Desktop. Sh!t is Legend.
@GolangDojo
@GolangDojo 3 жыл бұрын
Let's get it :)
@vanshajdhar9223
@vanshajdhar9223 3 жыл бұрын
Amazing explanation about encoding schemes and then relate those to golang practically. Thanks for creating this kind of content
@GolangDojo
@GolangDojo 3 жыл бұрын
More to come!
@jonathanrodriquez3775
@jonathanrodriquez3775 12 күн бұрын
great explanation !!
@RogiervandenBerg
@RogiervandenBerg 3 жыл бұрын
Amazing content, really focused and thoroughly explained. Well done and thanks! Yes I subscribed 😊 → 1 tip: Make the font of your IDE bigger. On my mobile phone it's really difficult (/ impossible) to read what you're typing.
@GolangDojo
@GolangDojo 3 жыл бұрын
Thanks for comment! Cool kid coding UI coming up for all future videos :)
@flexairz
@flexairz 2 жыл бұрын
Would not help people watching from a laptop. Seems to be your problem.
@gurekodok
@gurekodok 3 жыл бұрын
Thanks, waiting for more :)
@GolangDojo
@GolangDojo 3 жыл бұрын
More is indeed coming up!
@dawnrazor
@dawnrazor 2 жыл бұрын
Good work nice explanation
@SamiSabirIdrissi
@SamiSabirIdrissi 2 жыл бұрын
Nice bro, deep explanation. very nice!
@GolangDojo
@GolangDojo 2 жыл бұрын
Glad it helped!
@letsgetrusty
@letsgetrusty 3 жыл бұрын
Awesome explanation! Also the audio quality is great.
@GolangDojo
@GolangDojo 3 жыл бұрын
Thanks boi :)
@ricochetojosdemiel
@ricochetojosdemiel 3 жыл бұрын
me gustan tus videos saludos desde MExico quiero aprender
@adharshmanikandan2326
@adharshmanikandan2326 3 жыл бұрын
I love your go languagu tutorialsu, pleasu upload some web developmentu videosu. sorry for the engrishu, its a jokeu
@yo_mono
@yo_mono 3 жыл бұрын
You speak like an asian Christopher Walken haha. Great video, I'm always looking for a Go dedicated channel, so: Subscribed!
@GolangDojo
@GolangDojo 3 жыл бұрын
I'd take that as a compliment, and welcome!
@GauravSharma01
@GauravSharma01 2 жыл бұрын
awesome explaination!! Just have one question why does the rune has length of 3bytes for chinese character? rune is supposed to be int32(4 bytes) 🤔 It is just the length calculation golang is doing which would seem fair as utf-8 would only store 3 bytes or we actually saving space in memory within the process itself?
@GolangDojo
@GolangDojo 2 жыл бұрын
Rune isn't the most memory efficient compared to string. The extra byte is kinda just wasted.
@nicolasromagnoli
@nicolasromagnoli Жыл бұрын
Thanks, but I've got a question... how the hell do you scan a rune??
@arshadsiddiqui9071
@arshadsiddiqui9071 Жыл бұрын
I love this video. Sadly it's kinda niche.
@njengathegeek
@njengathegeek Жыл бұрын
This is so nicely explained. But why use light mode, that is not acceptable 😆
@rudde7251
@rudde7251 3 жыл бұрын
How do I get the length of a string in the number of charcaters. What would happen if you take the 11th element of that string? That's just garbage information, it couldn't be resolved to a character that makes sense. How can I "foreach" across each character in a string?
@GolangDojo
@GolangDojo 3 жыл бұрын
How do I get the length of a string in the number of charcaters? The only way I figured was turning the string into a rune slice - len([]rune("Hello 世界")) or use the foreach loop to count. What would happen if you take the 11th element of that string? It's going to return some ascii value depending how you print it out, unfortunately :( How can I "foreach" across each character in a string? You'd literally use a "foreach" loop in Golang -- for _, c := range "Hello 世界" Hope this helps buddy :)
@FalahHAbbas
@FalahHAbbas Жыл бұрын
Since Java 18 the default charset is UTF-8
@subediatul6191
@subediatul6191 3 жыл бұрын
please a video on struct
@GolangDojo
@GolangDojo 3 жыл бұрын
Coming up!
@dandcodes
@dandcodes 3 жыл бұрын
What IDE do you use?
@GolangDojo
@GolangDojo 3 жыл бұрын
That's Goland by JetBrain. Great IDE
@mgr1282
@mgr1282 3 жыл бұрын
GoFiber plz
@GolangDojo
@GolangDojo 3 жыл бұрын
Will eventually get to it!
@milkyway9225
@milkyway9225 2 жыл бұрын
wtf is this language for the first 8 seconds? wewewites wwiewieworld
@michalbotor
@michalbotor 2 жыл бұрын
mean
Golang Pointers - Fully Understanding Pointers in Go
8:16
Golang Dojo
Рет қаралды 9 М.
Golang String, Golang StringBuilder, Strings Library
22:44
Golang Dojo
Рет қаралды 11 М.
Gym belt !! 😂😂  @kauermotta
00:10
Tibo InShape
Рет қаралды 18 МЛН
Fast and Furious: New Zealand 🚗
00:29
How Ridiculous
Рет қаралды 45 МЛН
Sigma girl and soap bubbles by Secret Vlog
00:37
Secret Vlog
Рет қаралды 15 МЛН
Golang Generics. Do we ACTUALLY need them!?
12:51
Golang Dojo
Рет қаралды 19 М.
Strings, Bytes and Runes | Golang | intermediate level
14:04
Sreekanth
Рет қаралды 6 М.
Never write another loop again (maybe)
10:48
Dreams of Code
Рет қаралды 250 М.
Goroutines Crash Course (Mutex, Channels, Wait Group, & More!)
15:42
My 10 “Clean” Code Principles (Start These Now)
15:12
Conner Ardman
Рет қаралды 192 М.
Golang Generics is Officially HERE!! (Full Tutorial)
13:31
Golang Dojo
Рет қаралды 41 М.
So...you THINK you know Go?
6:34
Golang Dojo
Рет қаралды 16 М.
Samsung laughing on iPhone #techbyakram
0:12
Tech by Akram
Рет қаралды 7 МЛН