Golang Rune - Fully Understanding Runes in Go

Поділитися
Вставка
  • Опубліковано 15 лип 2024
  • 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
  • Наука та технологія

КОМЕНТАРІ • 36

  • @GolangDojo
    @GolangDojo  3 роки тому

    📝Get your *FREE Golang Cheat Sheet* -
    golangdojo.com/cheatsheet

  • @adamrhea2339
    @adamrhea2339 Рік тому +5

    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 роки тому +2

    Love to see Go _!_
    I also picked up Flutter/Dart this past couple years for App Development on Mobile & Desktop. Sh!t is Legend.

  • @vanshajdhar9223
    @vanshajdhar9223 3 роки тому +3

    Amazing explanation about encoding schemes and then relate those to golang practically. Thanks for creating this kind of content

  • @dawnrazor
    @dawnrazor 2 роки тому

    Good work nice explanation

  • @ricochetojosdemiel
    @ricochetojosdemiel 3 роки тому

    me gustan tus videos saludos desde MExico quiero aprender

  • @RogiervandenBerg
    @RogiervandenBerg 3 роки тому +9

    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 роки тому +4

      Thanks for comment! Cool kid coding UI coming up for all future videos :)

    • @flexairz
      @flexairz 2 роки тому +1

      Would not help people watching from a laptop. Seems to be your problem.

  • @letsgetrusty
    @letsgetrusty 3 роки тому +1

    Awesome explanation! Also the audio quality is great.

  • @gurekodok
    @gurekodok 3 роки тому +1

    Thanks, waiting for more :)

    • @GolangDojo
      @GolangDojo  3 роки тому +1

      More is indeed coming up!

  • @adharshmanikandan2326
    @adharshmanikandan2326 2 роки тому

    I love your go languagu tutorialsu, pleasu upload some web developmentu videosu. sorry for the engrishu, its a jokeu

  • @SamiSabirIdrissi
    @SamiSabirIdrissi 2 роки тому +1

    Nice bro, deep explanation. very nice!

  • @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 роки тому +1

      I'd take that as a compliment, and welcome!

  • @arshadsiddiqui9071
    @arshadsiddiqui9071 Рік тому

    I love this video. Sadly it's kinda niche.

  • @GauravSharma01
    @GauravSharma01 2 роки тому +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.

  • @njengathegeek
    @njengathegeek Рік тому

    This is so nicely explained. But why use light mode, that is not acceptable 😆

  • @FalahHAbbas
    @FalahHAbbas Рік тому

    Since Java 18 the default charset is UTF-8

  • @subediatul6191
    @subediatul6191 3 роки тому

    please a video on struct

  • @nicolasromagnoli
    @nicolasromagnoli Рік тому

    Thanks, but I've got a question... how the hell do you scan a rune??

  • @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 :)

  • @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