https://medium.com/swlh/processing-16gb-file-in-seconds-go-lang-3982c235dfa2
Arquivo da tag: Golang
Understanding GO Routine and Channel
How to deploy Go web application on AWS Elastic Beanstalk
Try and Catch in Golang
package main
import (
"fmt"
)
type Block struct {
Try func()
Catch func(Exception)
Finally func()
}
type Exception interface{}
func Throw(up Exception) {
panic(up)
}
func (tcf Block) Do() {
if tcf.Finally != nil {
defer tcf.Finally()
}
if tcf.Catch != nil {
defer func() {
if r := recover(); r != nil {
tcf.Catch(r)
}
}()
}
tcf.Try()
}
func main() {
fmt.Println("We started")
Block{
Try: func() {
fmt.Println("I tried")
Throw("Oh,...sh...")
},
Catch: func(e Exception) {
fmt.Printf("Caught %v\n", e)
},
Finally: func() {
fmt.Println("Finally...")
},
}.Do()
fmt.Println("We went on")
}
Golang get system language
GOLANG – Mongo-Driver
Deploying a simple GoLang Application to AWS Elastic Beanstalk (echo framework)
Error: pkg/mod/k8s.io/client-go@v11.0.0+incompatible/rest/request.go
error build k8s.io/client-go/tools/clientcmd
How to connect to Amazon RDS using go-sql-driver
import (
"database/sql"
"fmt"
_ "github.com/go-sql-driver/mysql"
)
db, err := sql.Open("mysql", "<username>:<password>@tcp(<AWSConnectionEndpoint >:<port>)/<dbname>")
if err != nil {
fmt.Print(err.Error())
}
defer db.Close()