So here is the assignment 3 for this course Go: The Complete Developer's Guide (Golang) by Stephen Grider, this assignment is a self research assignment which is why Stephen branded assignment3 as hard mode, this is an assignment to train students on how to read the Go documentation. It is not overly hard but it … Continue reading [Go]Assignment 3: Open a text file and display the content
This is an assignment 2 about interface from the course Go: The Complete Developer's Guide (Golang) by Stephen Grider, this topic is difficult to understand but Stephen explained it well. Below is the code for the assignment2. So the purpose of interface in golang is to try to reduce the code, while golang is not … Continue reading [Go]Interface assignment 2
This is an assignment 1 by Stephen Grider in his Go: The Complete Developer's Guide (Golang) from udemy. By far the easiest to follow and least boring lesson about Go, well I said by far the easiest is because I bought a lot of courses from other instructors and none of them matches how Stephen … Continue reading [Go]Indicate from 0 to 10 which is even and which is odd
9Pointer is a variable that stores the memory address/register of the variable. If you extract the pointer variable without the asterix(*) sign, you will only get the register of the variable. In order to get the value you need to de-reference the pointer variable by using the asterix(*).
While array in Go is fixed size, slice on the other hand is not. You declare a variable without specifying the size, and if new element is needed use the append() function to add element to each index.
Array is fixed in size hence it is not flexible, I need to declare the size of the array, and the values cannot exceed the size which I declared.
Go has some similarity with python and a lot are different, fortunately during my university I was forced to take up foundation of programming which I have learned C. So below are the codes which I have put in comments to explain the statements. simplemath package Main package that imports simplemath and runs it