Can you please fix the grammar, false information in my notes: In this section, we will…
- User
Can you please fix the grammar, false information in my notes:
In this section, we will go over six main points about the programming language.
- Go is staticaly type langauge, this means that you have to type the data type excplicitly or they have to inferred. These types can not change unless using type conversion.
- Go is a strongly type lanauge meaning, you can not add string with numbers.
- Go is compiled meaning that it gives you execution file
- Go has a fast compile time meaning that we are able to compile and test quickly
- Built in concurreny meaning a lot of stuff already come with go.
- Simplicity.
We also leanred the cocenpts of modules nad packages, packages are folders of Go code. Where as modules are a collection of these packages. So when we create our Go project we are creating a module because we will be creating multiple packages.
So in your diroectoy, you want to use the command
go mod init mod_name or github link.Every, go file belongs to a package, the package names goes at the very top of the code (
package name). The main package is a unique package, becasue it tells the compiler that this is the entry point. This main package needs to take in the main function. This function is the entry point. This function takes in no parameters.package main import "fmt" func main(){ fmt.Println("Hello World!") }To run this code, you can use the
go run filename. This will compile and run your code. - Assistant
In this section, we will go over six main points about the Go programming language.
-
Go is a statically typed language, which means that you have to specify the data types explicitly, or they have to be inferred by the compiler. These types cannot change unless you use type conversion.
-
Go is a strongly typed language, meaning you cannot perform operations that mix types arbitrarily, such as adding strings and numbers directly without explicit conversion.
-
Go is compiled, meaning that it generates an executable file from your source code.
-