Coding with Golang October 21st, 6-7PM Sign in
What is a GDSC? Google Developer Student Clubs
We’re open to all majors! If you would like to join GDSC at UCF, it’s easy! The linked slide deck has all of our socials, calendar, mailing list, a step-by-step guide on joining Bevy (our Google-created RSVP site), and more! tinyurl.com/gdsc-ucf-join-in Want to Join GDSC?
https://linktr.ee/knighthacks linktr.ee/knighthacks Knight Hacks
Meet today’s speakers Hannah Moss GDSC UCF - Lead/President Alice Yu GDSC UCF - VP/Co-Lead Andrei Gulapa GDSC UCF - Marketing Lead
What is Golang/ Go? ● Golang or..Go? ○ go.org was not available → golang.org! ○ “Golang” == “Go” (but the actual language is called Go!) ● Created by Google in 2007 ● Open source programming language
Uses
Companies using Go
● Easy to learn! Syntax is clean and simple ● Fast and secure ● Garbage collection ● Easy concurrency model Pros
● No generics ● Poor library support ● Time-consuming to write Cons
Hello World! - Packages - Imports - Functions / main - All material is pulled from https://tour.golang.org/welcome/1 (Official Go website) Syntax -
Let’s do some math! - Imports - Exports - All material is pulled from https://tour.golang.org/welcome/1 (Official Go website) Syntax -
Let’s do some math! - Functions - Syntax -
Let’s do some math! - Shortened function parameters - Syntax -
Swappy swap - Multiple return types - All material is pulled from https://tour.golang.org/welcome/1 (Official Go website) Syntax -
Practice time! - Let’s code up a split number function! - Split the number 17 into 2 numbers - Syntax -
Practice time! - What is the return type? - Shorten this function’s return parameters - Syntax -
Practice time! - What is the return type? - Shorten this function’s return parameters - Syntax -
Let’s talk about variables! - Declaring - All material is pulled from https://tour.golang.org/welcome/1 (Official Go website) Syntax -
Let’s talk about variables! - Initializing - If we wanted to initialize var i, j to 1 and 2, what would it look like? - All material is pulled from https://tour.golang.org/welcome/1 (Official Go website) Syntax -
Let’s talk about variables! - Initializing - If we wanted to initialize var i, j to 1 and 2, what would it look like? - All material is pulled from https://tour.golang.org/welcome/1 (Official Go website) Syntax -
Let’s talk about variables! - Short var declarations - Used frequently - All material is pulled from https://tour.golang.org/welcome/1 (Official Go website) Syntax -
Loops - For loops - What does a typical for loop parameter look like for int i for (i < 10) comparisons? - What if we used a shortened var initialization to initialize i? What would it look like? Syntax -
Loops - For loops - All material is pulled from https://tour.golang.org/welcome/1 (Official Go website) Syntax -
Loops - While loop - Basically a shorted for loop - All material is pulled from https://tour.golang.org/welcome/1 (Official Go website) Syntax -
If statements Syntax -
If statements You can shorten if statements that have preconditions Syntax -
How can you replicate the Sqrt function? You’ll need to use a for loop and declare extra variables! Template: Square roots Time for your own practice! Brain teaser https://tour.golang.org/flowcontrol/8
Discord Setup Steps - Overview 1. Set Up Discord Server 2. Create a new Discord Application - https://discord.com/developers/applications a. Create a new Discord Bot 3. Connect the Bot to your Server Let’s Dive in!! Let’s Build A Discord Bot
Repl.it Setup Steps - Overview 1. Create a new Repl within Repl.it https://replit.com/ 2. Import discordgo library : github.com/bwmarrin/discordgo 3. Add Discord bot’s token to repl Let’s Dive in!! Let’s Build A Discord Bot
Coding Time! Let’s Build A Discord Bot
Coding with Golang Sign in Thank you!

Coding with golang

  • 1.
    Coding with Golang October21st, 6-7PM Sign in
  • 2.
    What is aGDSC? Google Developer Student Clubs
  • 3.
    We’re open toall majors! If you would like to join GDSC at UCF, it’s easy! The linked slide deck has all of our socials, calendar, mailing list, a step-by-step guide on joining Bevy (our Google-created RSVP site), and more! tinyurl.com/gdsc-ucf-join-in Want to Join GDSC?
  • 5.
  • 6.
    Meet today’s speakers HannahMoss GDSC UCF - Lead/President Alice Yu GDSC UCF - VP/Co-Lead Andrei Gulapa GDSC UCF - Marketing Lead
  • 8.
    What is Golang/Go? ● Golang or..Go? ○ go.org was not available → golang.org! ○ “Golang” == “Go” (but the actual language is called Go!) ● Created by Google in 2007 ● Open source programming language
  • 9.
  • 10.
  • 11.
    ● Easy tolearn! Syntax is clean and simple ● Fast and secure ● Garbage collection ● Easy concurrency model Pros
  • 12.
    ● No generics ●Poor library support ● Time-consuming to write Cons
  • 13.
    Hello World! - Packages -Imports - Functions / main - All material is pulled from https://tour.golang.org/welcome/1 (Official Go website) Syntax -
  • 14.
    Let’s do somemath! - Imports - Exports - All material is pulled from https://tour.golang.org/welcome/1 (Official Go website) Syntax -
  • 15.
    Let’s do somemath! - Functions - Syntax -
  • 16.
    Let’s do somemath! - Shortened function parameters - Syntax -
  • 17.
    Swappy swap - Multiplereturn types - All material is pulled from https://tour.golang.org/welcome/1 (Official Go website) Syntax -
  • 18.
    Practice time! - Let’scode up a split number function! - Split the number 17 into 2 numbers - Syntax -
  • 19.
    Practice time! - Whatis the return type? - Shorten this function’s return parameters - Syntax -
  • 20.
    Practice time! - Whatis the return type? - Shorten this function’s return parameters - Syntax -
  • 21.
    Let’s talk aboutvariables! - Declaring - All material is pulled from https://tour.golang.org/welcome/1 (Official Go website) Syntax -
  • 22.
    Let’s talk aboutvariables! - Initializing - If we wanted to initialize var i, j to 1 and 2, what would it look like? - All material is pulled from https://tour.golang.org/welcome/1 (Official Go website) Syntax -
  • 23.
    Let’s talk aboutvariables! - Initializing - If we wanted to initialize var i, j to 1 and 2, what would it look like? - All material is pulled from https://tour.golang.org/welcome/1 (Official Go website) Syntax -
  • 24.
    Let’s talk aboutvariables! - Short var declarations - Used frequently - All material is pulled from https://tour.golang.org/welcome/1 (Official Go website) Syntax -
  • 25.
    Loops - For loops -What does a typical for loop parameter look like for int i for (i < 10) comparisons? - What if we used a shortened var initialization to initialize i? What would it look like? Syntax -
  • 26.
    Loops - For loops -All material is pulled from https://tour.golang.org/welcome/1 (Official Go website) Syntax -
  • 27.
    Loops - While loop -Basically a shorted for loop - All material is pulled from https://tour.golang.org/welcome/1 (Official Go website) Syntax -
  • 28.
  • 29.
    If statements You canshorten if statements that have preconditions Syntax -
  • 30.
    How can youreplicate the Sqrt function? You’ll need to use a for loop and declare extra variables! Template: Square roots Time for your own practice! Brain teaser https://tour.golang.org/flowcontrol/8
  • 31.
    Discord Setup Steps- Overview 1. Set Up Discord Server 2. Create a new Discord Application - https://discord.com/developers/applications a. Create a new Discord Bot 3. Connect the Bot to your Server Let’s Dive in!! Let’s Build A Discord Bot
  • 32.
    Repl.it Setup Steps- Overview 1. Create a new Repl within Repl.it https://replit.com/ 2. Import discordgo library : github.com/bwmarrin/discordgo 3. Add Discord bot’s token to repl Let’s Dive in!! Let’s Build A Discord Bot
  • 33.
  • 34.