목록고 언어 (Go Lang) (4)
종우의 컴퓨터 공간

Go is not a OOP language like Java or Python. To use it as an OOP language, we can use this design pattern of what is called custom type. Custom type can be created by using one of the existing primitive data types such as string, integer, or slice. It is possible to use receiver function to add functionality to it which only can be accessible through using it. (고는 자바나 파이썬처럼 객체지향 언어가 아니다. 하지만 커스..
Array: fixed length list of things every element in an array must be of the same type Slice: another type of array that can grow or shrink every element in a slice must be of the same type
Types of packages: executable: generates a file that we can run e.g. package main ("main: is special. must have a func called "main") reusable: code used as "helpers" a good place to put reusable logic e.g. package (defines a package that can be used as a dependency; helper code) import statement: it is used to gain access to another package inside of the one that we are authoring it can be eith..
go build: compiles a bunch of go source code files go run: compiles and executes one or two files go fmt: formats all the code in each file in the current directory go install: compiles and "installs" a package go get: downloads in raw source code of someone else's package go test: runs any tests associated with the current project