I have a code more or less with this structure:
package main
import (
"html/template"
"net/http"
"log"
)
func main() {
http.HandleFunc("/",taltal)
http.ListenAndServe(":8080",nil)
}
func check(err error){
if err != n...
I'm starting the first step in go and I'm needing it first get a text file to open it and filter by line where each line is separated by | and I will make a if to show certain line
Example:
Text file content:
|C100|1|0||5...
How do I get a period between two dates?
d1, _ := time.Parse(time.RFC3339, "2018-10-27T00:00:00Z")
d2, _ := time.Parse(time.RFC3339, "2018-10-28T00:00:00Z")
// Não funciona.
fmt.Println(d2 - d1)
Does anyone use Go accessing firebird database? I'm having connection problems and I can not solve it !!
My connection string
Conn, err: = sql.Open ("firebirdsql", "sysdba: masterkey @ localhost: \ adhnet \ adhmaster.gdb")
Below is the...
I created the following script to compile a project as static in go, but I'm not getting a static executable.
PASTA=bin/scak_linuxAMD64
ARQUIVO=$PASTA/server_rest
export GOOS=linux
export GOARCH=amd64
export CGO_ENABLED=1
export CXX_FOR_TARGE...
I have already installed the MinGW x64 and also TDM-GCC-64, created the environment variables pointing to the bin folder and when I give a
go get github.com/mattn/go-oci8
My terminal returns this error message.
I'm having trouble importing a go library. The library is in a folder in the same project directory and always the import error, when not the import error, of the error to access the function.
main.gopackagemainimport("fmt"
"./test"
)
f...
I'm trying to make this request "oauth / request_token" on twitter using go.
// GET PARAMS TO REQUEST
t := time.Now().Format("20060102150405")
values := make(url.Values)
values.Add("oauth_nonce", auth.ANonce)
values.Add("oauth_callback", auth....
I started learning Go recently. I want to be able to save a data type to a variable, and convert another variable to it. I know one way to save a data type is by using reflect.Type .
i := 5
t := reflect.TypeOf(i)
var f float32 = 4.2
B...
Installing go into /usr/local/go occurs perfectly and I can check this using:
go --version
When attempting to use get with:
go get github.com/russross/blackfriday
I get the following error:
pa...