golang

Installing go language packages on windows

I will probably ask a rather stupid question. How do I install packages from github or golang for the go language on windows via the console? I know that on likunse it is done via get , but how on Windows?

I can't start the training course (Golang tour)

I don't understand what I need to do so that I can open Golang Tout (Russian version) in the browser. Russian version (Not wo ... ood only that I need to update Golang, but how to do it if it is all installed and started like on their server. (In my view)

I can't run the code on Go via cmd.exe on Windows 10

The other day, I, a novice, installed Windows 10 Go version 1.13.4. Everything seems to be installed correctly, and GOPATH wa ... go-build464688474\b001\exe\hello.exe" "- o " is not an internal or external command executed by a program or a batch file.

Using time in Golang

There is a simple task. The standard input is provided with a string representation of the date and time in the following for ... arsing time "1986-04-16T05:20:00+06:00" as "Mon Jan 2 15:04:05 MST 2006": cannot parse "1986-04-16T05:20:00+06:00" as "Mon"

How to create an n-dimensional array in GoLang?

How to create an n-dimensional array in GoLang? For example, as in Python numpy, where you can create an array of zeros with a single function numpy.zeros([n чисел])

Error, if the proxy is invalid. Golang

I send a request to a site with a proxy enabled and everything works, but in the case of a dead proxy, I get an error. [signa ... ody, err := ioutil.ReadAll(req.Body) if err != nil { fmt.Println("ошибка") } fmt.Println(string(body)) }

How do I describe a function that accepts different types of arguments?

I want to create a map whose keys are strings and whose values are functions: var Items map[string]func(a string, b string) ... should I do if I need to add a function with other types and the number of incoming arguments to the map? How is this solved?

The Redis client returns the redis: nil error

I am writing a client wrapper Redis for caching data downloaded from online services: import ( "github.com/go-redis/redi ... in ExclusionsByProcessor() and other methods. Ping() works everywhere. The commented out code in NewAudioCache() also works.

Download the plugin to Intellij IDEA from disk

How to install the golang plugin version 9.16 from the disk to Intellij IDEA, where the problem with environment variables is ... r ubuntu or mac os, but at the moment there is no possibility to work on these oss. Are there any build options for Windows?

How do I pass the value of a variable from the go code to a stored procedure?

Go code: func main() { psqlInfo := fmt.Sprintf("host=%s port=%d user=%s password=%s dbname=%s sslmode=disable", ... lpgsql AS $function$ begin return query (select * from mytable where id=i); return; end $function$ ;

Golang REST API error response

Ideologically correct error return to the REST API client For example a simple REST API: package main import ( "fmt" ... ror handling choose when the error comes from the" depth " of the project and with each level becomes overgrown with context?

permission denied in docker

Created a simple Dockerfile: FROM golang EXPOSE 8080 80 443 # Set pwd to the go folder WORKDIR ${GOPATH} RUN apt-get upda ... 16:29 main.go drwxrwxrwx 2 root root 4096 Feb 28 08:13 migrations drwxrwxrwx 3 root root 4096 Feb 20 08:26 templates

Error reading from SQL: Scan called without calling Next

rows, err2 := database.Query("select excursion_id from ex_img where id = 12") if err2 != nil { fmt.Println("ошбика выбор ... &p.Id) if err2 != nil { fmt.Println("ошибка записи в структуру: ", err2) } Error: Scan called without calling Next.

How to compactly write "Exclusive OR"?

How do I implement an exclusive or? In most languages, this construct is not implemented at the language level. Therefore, we ... le.very_long_name_field_1.very_long_subname_field_a As an answer, give a compact example of calculating XOR (excluding or).

Reverse the letters in a word using range and append. Golang

Task: implement the reverse of letters in a string (range by the array rune + append). According to the documentation, append ... return string(newWord) } func main() { fmt.Println(ReverseString("Hello")) } Https://play.golang.org/p/YYLljr0fv_5

Connecting to MySQL in Go

Good afternoon. I can't connect to MySQL from Go, MySQL is installed and running. Please tell me what it lacks? After "Googl ... ame/go/src/pkg/net/fd.go:236 +0xe4 created by net.newPollServer /home/username/go/src/pkg/net/newpollserver.go:35 +0x382

Development environment for Go [closed]

Closed. It is impossible to give an objective answer to this question . Answers to it are not accepted at the moment. ... Syntax highlighting Auto substitution Cross-platform solution Automatic code assembly As an extension: Working via ssh

golang compiling for hosting

The task is to compile a program for the site on Golang, which will be called inside the CGI script. Hosting is not virtual, ... .Printf("Content-type: text/html \n\n") fmt.Printf("<html><body>hello, world</body></html>\n") }

Replacing a word with regular expressions

There is a text, for example Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ... t? You can break it down by words, and go through if, and then replace it somehow, but maybe there is a more convenient way?