Home
About
  • Learning Golang: Random numbers

    Feb 20, 2021 golang

    This is part 23 of my journey learning Golang. Random number generators For some kinds of programs, like simulations, games, or test code, it is useful to be able to generate unpredictable sequences of numbers. While generating truly random numbers is a hard problem (see RANDOM.ORG), a common alternative is to use a …

    Read More
  • Learning Golang: Scoped shorthand variable declaration

    Feb 14, 2021 golang

    This is part 22 of my journey learning Golang. Variable scopes A common source of errors in programming is using the same variable in many different parts of a program. For a deep dive into the problems that this practice can cause, take a look at Global Variables Are Bad. A common solution that is adopted by most …

    Read More
  • Learning Golang: switch

    Dec 19, 2020 golang

    This is part 21 of my journey learning Golang. Chained conditions It is a common pattern for a program to have a sequence of conditional statements testing for different values of the same variable or function result. For instance: 1package main 2 3import ( 4 "fmt" 5) 6 7func main() { 8 x := 0 9 y := 0 10 for …

    Read More
  • Learning Golang: Logical operators

    Oct 9, 2020 golang

    This is part 20 of my journey learning Golang. Boolean algebra Boolean algebra is about logical operations applied to the boolean values true and false. The most common operations are “and” (conjunction), “or” (disjunction) and “not” (negation). Fun fact: it is called …

    Read More
  • Learning Golang: if and else

    Oct 8, 2020 golang

    This is part 19 of my journey learning Golang. Conditionals Any program can be written in terms of three control structures: the sequence structure, in which expressions are executed in sequence, one after the other, in the order that they are written; the selection structure, in which a statement can be executed or …

    Read More
  • Learning Golang: Scan, Scanln and Scanf

    Sep 19, 2020 golang

    This is part 18 of my journey learning Golang. Command line interface When building programs that run on a terminal it is often useful to be able to allow the user to enter text. For instance the ssh-keygen utility will prompt for a path and a passphrase. 1❯ ssh-keygen -t rsa -b 4096 -C "your_email@example.com" …

    Read More
  • Learning Golang: Sprint, Sprintln, Sprintf

    Sep 16, 2020 golang

    This is part 17 of my journey learning Golang. The fmt package has methods like Print, Println and Printf to print text to the standard output device. It also has corresponding methods that return the strings that would be printed out, instead of actually printing them out. Afterwards the program can use the returned …

    Read More
  • Learning Golang: Printf

    Sep 15, 2020 golang

    This is part 16 of my journey learning Golang. The Printf method The Printf method from the fmt package writes a formatted string to standard output. Printf makes it possible to interpolate strings. This is done by leaving placeholders in a string, and using values to fill in these placeholders. Printf syntax Printf …

    Read More
  • Learning Golang: Println and Print

    Sep 12, 2020 golang

    This is part 15 of my journey learning Golang. fmt Package Go’s fmt package implements formatted I/O with formatting functions in the venerable, old-school style of the C language, but modernized. This article covers the most basic functions for printing out text Println and Print: Println The Println method …

    Read More
  • Learning Golang: Assigning and printing variables

    Sep 11, 2020 golang

    This is part 14 of my journey learning Golang. As an exercise for Codecademy’s Learn Go course, I wrote my second Go program. It simulates a catalog for a comic book store. At this point the course has only covered the most fundamental parts of Go, like variables, simple data types, basic arithmetic, and …

    Read More
    • ««
    • «
    • 1
    • 2
    • 3
    • »
    • »»

Fernando Correia

Principal Software Engineer at Domino Data Lab. We're hiring!

Read More

Featured Posts

Recent Posts

  • My origin story: TK85
  • Learning Golang: Random numbers
  • Learning Golang: Scoped shorthand variable declaration
  • Learning Golang: switch
  • Learning Golang: Logical operators
  • Learning Golang: if and else
  • Learning Golang: Scan, Scanln and Scanf
  • Learning Golang: Sprint, Sprintln, Sprintf

categories

LEARNING-GOLANG 23 PERSONAL 1

tags

GOLANG 23 BLOGGING 3 DNS 1 GITHUB-PAGES 1 ORIGIN 1

Copyright ©  Fernando de Alcantara Correia. Licensed under the Creative Commons Attribution 4.0 International (CC BY 4.0) License.