Most voted "golang" questions
Use this tag when the question refers to some resource, information, or problem relating exclusively to the Go programming language. Go (also known as Golang) is an open source programming language initially developed in Google, high-level, with strong, secure, nominal and structural typing, manifest or inferent, essentially imperative paradigm and which has competition mechanisms.
Learn more…111 questions
Sort by count of
-
-1
votes1
answer42
viewsHow to convert two separate field values of a JSON into a Go map?
I have a JSON that looks like this: { "estados":[ { "sigla": "SP", "nome": "São Paulo" }, { "sigla": "RJ", "nome": "Rio de Janeiro" } ] } How can I turn this JSON in a map in Go, where the keys to…
-
-1
votes1
answer68
viewsblack hat book go/ variable not used in golang
func foo(i interface{}) { switch v := i.(type) { case int: fmt.Println("I'm an integer!") case string: fmt.Println("I'm a string!") default: fmt.Println("Unknown type!") } } I researched this…
golangasked 4 years, 3 months ago harakirisekaini 1 -
-1
votes1
answer75
viewsHow do I take a specific part of a string in GOLANG
I am developing a software and among its features I would like to separate a specific part of a string My code is like this so far baseURL := "https://google.com/" body, _ :=…
-
-1
votes1
answer38
viewsDoubt about the type of permission when creating folder and file with. mkdir() and.openfile()
People, at a certain point in my code I am creating a folder (1) in which will be archived photos posted by users and a CSV file (2) in which will be archived the metadata of these images. I’m…
-
-1
votes1
answer89
viewsHow to parserar JSON from Response in Golang
Once again, I on this site. This time, I’m having a hard time parsing the API response I’m communicating with. The API in question is this one: https://api.brasil.io/v1/dataset/covid19/caso/data/?…
-
-1
votes1
answer60
viewsError Importing Golang Package
I’m trying to call a function from another package on main but when I import and try to use the exported function returns the error of "package functions imported but not used". Function.go…
-
-1
votes1
answer114
viewsGenerate PDF in Golang
Good morning everyone, I am new to the Golang language and I am having difficulties in a text printing file in PDF generation that I was asked to study. The difficulty is in creating the variable…
-
-2
votes1
answer120
viewsRename golang files without removing . from the extension
I need to rename files from a directory removing spaces and accents solved both but I had a side effect because I lost the . of extension. Follow the code link: Golang Playground Code: package main…
-
-2
votes1
answer61
viewsHow to read the html of a page that only loads when opening in GOLANG browser
I’m trying to read the HTML from the following page (https://www.lojacorpoperfeito.com.br/search/? search=supplements&index=0/), but the problem is that its HTML is only loaded when it is opened…
-
-2
votes1
answer85
viewsProblem with the calculator in Go [BEGINNER]
Guys, I’m a beginner in programming and I’m trying to practice doing a calculator in Go. Can anyone explain to me why when I try to calculate, the results are always returning me the 0? Am I…
-
-6
votes3
answers177
viewsHow to initialize a constant with the value of time. Now() in Golang?
I’m used to doing projects in Python where, when initializing the same I keep a variable saying when it started (to measure the execution time of the project) like this: import time started_at =…