Categories
Uncategorized

DartPad an Online Dart Compiler

https://dartpad.dev/?null_safety=true

Categories
Uncategorized

Android Emulator Hypervisor Driver for AMD Processors

https://github.com/google/android-emulator-hypervisor-driver-for-amd-processors

Categories
Uncategorized

Every Thing Is Important (Prioritise)

Categories
Uncategorized

Hello World in Function, Anonymous Function, First-Class Function.

package main
     
import "fmt"
     
func helloGo() {
    fmt.Println("Hello Go from a Function")
     
} 
     
func main() {   
    helloGo() 
    func() { fmt.Println("Hello Go from an Anonymous Function") }()
    var hello func() = func() { fmt.Println("Hello Go from an Anonymous Function Variable") }
    hello()
} 
Categories
My Go Tutorial Uncategorized

Using Map with Examples

Read Me First

Refer to the Go Language Specification documentation for map type. A copy of the map type specification posted on this website.

MapType     = "map" "[" KeyType "]" ElementType .
KeyType     = Type .
Type      = TypeName | TypeLit | "(" Type ")" 

Map build-in function

len()

Syntax : keyword [ key type ] element type

Keyword : map

[key type] can be all Go type EXCEPT map, slice and function

s := make([]string,0)

Invalid key type map[s]string, s is a slice of string type.

Element type can be byte, int, float64, string, struct

var m map[int]int

m := map[int]int

m := map[int]string

m := map[string]int

m := map[string]string

Map of struct type

type name struct {
     firstName string
     lastName string
     age int
}

Note: the key type must NOT be function, map or slice

m := map[string]name

Initialize a map using the make function, value of nil assigned

myMap := make(map[int]string)

initialize the map with some values

myMap = map[int]string{1: “first”, 2: “Second”, 3: “third”}

Add elements into the map

m := map[string]float64{
    "pi" : 3.14,
    "ftom" : 0.3,
}

Map literal add two(2) element added to m. Note the operator “:=” and {} backets end of

m := map[string]string
m["first"] = "first name"

To obtain a value from a map

//x will hold the value in “myMap” that corresponds to key 3
var x = myMap[3]

Check if a key exists in a map

//If the key 5 is not in “myMap”, then “ok” will be false
//Otherwise, “ok” will be true, and “x” will be the value
x,ok := myMap[5]

Type      = TypeName | TypeLit | "(" Type ")" 
Categories
Uncategorized

No Login Here

The site does NOT allow for comments and the creation of a new user account. You have been informed of these rules of restrictions.

Stop doing the login activities here it is an act of HACKING violation. You have been warned.

Categories
Uncategorized

TinyGO (Windows platform)

A Go compiler for microcontrollers (such as Espressif (ESP8266/ESP32), Arduino (Arduino Uno -Atmega),  BBC microbit ARM Cortex-M0 )

https://tinygo.org/

Windows 10 Setup

https://tinygo.org/getting-started/windows/

Categories
Uncategorized

Go Environment – GOPATH

$GOPATH specifies the top-level directory containing source code for all our Go projects, this directory is known as Go Workspace

The default value of $GOPATH /home/username/go in Linux Distribution platform. On Windows platform is /user/username/go.

On the /home/username/go folder our Go workspace sub-folders must have the following which our task it create three (3) new sub-folders {src,bin,pkg}.

  • /home/username/go/src
  • /home/username/go/bin
  • /home/username/go/pkg

Our project folder will be sub-folder of /home/username/src, let say to print a hello world message. Create a new sub-folder “helloworld folder” under src folder. Inside the sub-folder helloworld, create a go source file “helloworld.go”.

Categories
Uncategorized

Go as a scripting language in Linux shell using gorun and Kernel binfmt_misc.

Categories
Uncategorized

Go package net/http for web scraping or spidering. Understanding of robots.txt

https://support.google.com/webmasters/answer/6062608?hl=en