Definition of GO Package

Go programs are organized into packages. A package is a collection of source files in the same directory that are compiled together. Functions, types, variables, and constants defined in one source file are visible to all other source files within the same package.

Interface with abstract of methods

Defining an Interface Keyword : type, interface Interface_name user provide a descriptive name Within the { } curly bracket, method sets are a list of method_name has been defined method name with parameters, return. No implementation details. the FileInfo interface has the following method sets: Name() string // return Read more…

Struct type

Struct types A struct is a sequence of named elements, called fields, each of which has a name and a type. Field names may be specified explicitly (IdentifierList) or implicitly (EmbeddedField). Within a struct, non-blank field names must be unique. StructType = “struct” “{” { FieldDecl “;” } “}” . FieldDecl = Read more…

Go Modules

A module is a collection of Go packages stored in a file tree with a go.mod file at its root. The go.mod file defines the module’s module path, which is also the import path used for the root directory, and its dependency requirements, which are the other modules needed for Read more…

Compiler Explorer.

Compiler Explorer is an interactive tool that lets you type code in one window and see the results of its compilation in another window. Using the site should be pretty self-explanatory: by default the left hand pane is the source window and the right hand has the assembly output.