Skip to content

gsbcamargo/go-studies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go annotations

general commands

go mod tidy is used to remove unused dependencies from the go.mod file

access modifiers

so, apparently Go doesn't have access modifiers because it isn't an object oriented programming language

what is used to denote an access modifier is: the method usually begins with a capital letter (see packages/helper/helper.go) when the function is public, and with a lower case letter when the method can be accessed only at package level

i found that interesting that's why i'm writing this down

variable and constants

you can use the short := to declare a variable, making use of the type inference provided by go on the other hand, you cannot do this when declaring a constant when doing so, you must declare it explicitly, eg.:

const Constant string = "i'm a constant"

string interpolation

using string interpolation in go is pretty straight forward just write it like this fmt.Printf("%s", string) (take a closer look at the docs here.)

About

Golang knowledge dump

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages