Re: [go-nuts] study go package

2018-01-19 Thread Gianguido Sorà
I think that the Go source code itself is among the best sources of good practices and well-written Go. Il 19 gen 2018 13:52, "Keith Brown" ha scritto: > I want to pick up good practices when developing my go code. Is there a > package which I can study and comprehend for newbies? I mainly use >

Re: [go-nuts] Go Compiler How Work?!

2017-12-15 Thread Gianguido Sorà
No, Go doesn't use LLVM. Il 16 dic 2017 00:45, "Compiler" ha scritto: > Last Version of Go Compiler doing Generate `ASM Code` and next Linker... > and final binary output file? > > > Go Compiler is use LLVM/IR? > > > go1.4/doc/go_faq.html : > > We considered using LLVM for gc but we felt it was

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread Gianguido Sorà
The compiler does produce an executable without any C involved. Il 13 dic 2017 13:20, ha scritto: Could you first answer this question? They question may also be answered. *how can make a new compiler programming language using c without assembly?(a compiler then can produce executable file) ??

Re: [go-nuts] Combine low traffic website

2017-12-08 Thread Gianguido Sorà
You could run the two programs on the same vps by binding them to localhost and two different ports, and then use a reverse proxy (like nginx) to multiplex connections and add HTTPS. This way you can have one machine that responds to two distinct domains, each of which will point to one of your ap

Re: [go-nuts] Re: Is the result right or not?

2017-12-06 Thread Gianguido Sorà
What are you trying to achieve with this code? What do you want it to do? Il 06 dic 2017 15:30, "T L" ha scritto: > And this: > > package main > > import "fmt" > > func main() { > var i int > var x = []int{3, 5, 7} > //var y = make([]int, 3) > for i, x[i] = range x { > } > fmt.Printl

Re: [go-nuts] Re: How to convert JSON message to Go struct

2017-10-11 Thread Gianguido Sorà
You should operate type assertion by iterating on the array. My advice is to write a "Work" struct with all the field you need, and create an instance for each iteration of the outer array. This way you'll have a nice representation of a "Work" package for each inner array. I cannot p

Re: [go-nuts] How to covert simple RPC Call in Python to Go?

2017-10-10 Thread Gianguido Sorà
Since the server is communicating using JSON structures, you should unmarshal the Read() data in a struct to actually use it: https://blog.golang.org/json-and-go. Unlike Python where JSON is typically handled through dictionaries, in Go you either provide a structure to unmarshal data to, or work