Questions tagged as 'go'

2
answers

Matrix length in Go

I'm starting with Go (or Golang), and I wanted to know how to get the size of a matrix, for example of type [][]uint8 . I tried using len , but it gives me an error.     
asked by 28.12.2016 / 00:53
2
answers

Is it possible to modify the JSON options in html / template?

html/template has a very convenient feature. If I have a template like this: <html> ... <script>var x = '{{ .Data }}';</script> ... </html> The variable Data can be of any type, and html/template...
asked by 11.09.2016 / 20:52
1
answer

Problem when creating WebService in Golang

I am doing a WS , where I make a query to the database, as the database to which I made the query is Informix , the connection was made through ODBC , the problem that I have is when creating the json due to the variabl...
asked by 25.05.2018 / 22:20
2
answers

Parse link header in golang

I want to make a request in Go to an API but the answers are paged so I have to go through them. The pagination comes on the header in the element link , something like this: <page=3>; rel="next",<page=1>; re...
asked by 15.04.2016 / 02:58
1
answer

"index out of range" in Go

Managing arrays in Go I realize that there are two ways to declare them. Form 1 When I declare the array with the fixed size var a [5]int a[0] = 1 The above does not give any problem. Form 2 When I declare the array...
asked by 24.03.2016 / 05:32
2
answers

Use strings.Replace () to replace all the values of a dictionary in a string

I have used this function a couple of times and now I have an exercise which I can not even run. I have a string ( cadena ) and a dictionary ( griegoDicc ), I need to replace each Greek character with the numeric value. But "result"...
asked by 23.01.2018 / 19:47
1
answer

How to integrate Go's famework with ReactJs?

In a project it is already defined that we are going to use Golang for the Backend and its Siris framwork, but for the Frontend it is going to use react. I have not seen that integration before.     
asked by 22.02.2018 / 00:47
1
answer

Problem with tickers in go

Good morning, I hope you can support me. I'm doing a dummy to test the tickers in go: package main import( "fmt" "time" ) func main(){ ticker := time.NewTicker(time.Millisecond * 500) go func() { for t := range ticker....
asked by 13.04.2016 / 17:18
2
answers

How to import local packages in go?

I am new to golang and I need to understand how GO implements the packages in general. I want to implement a local package to separate my code and keep it organized. I have the following example: nums.go package nums func Even(i int)...
asked by 01.09.2016 / 17:06
1
answer

Return Json to the client

I explain my code a bit: I have a form that worked under PHP and to learn what is happening to GO, it turns out that I want to verify if a person is already registered, with which I ask for your ID and launch the action "ExistencePersona". I...
asked by 09.02.2018 / 15:22