[go-nuts] Re: Doing "C-like" things in Go

2017-09-18 Thread Sokolov Yura
for a|b != 0 { do_something() -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit

[go-nuts] Go tool for formatting sql in the source code

2017-09-18 Thread Aravind Kumar
Hi, In my job I write a lot of sql. I'd like to extend gofmt's functionality such that it also formats the queries in the go code. The problem is I find it overwhelming to learn about go code comprehension. It would be of great help if you could give me a reading list or some pointers on where

[go-nuts] suggestions about reusing function information in comments, swagger, ...

2017-09-18 Thread brunetto
Hi all!! I apologize if someone is seeing this mail twice but it seems I didn't send it the first time. For some (web) Go projects I'm developing in my company is required to write few information about functions (and methods) * comments (at lest for the exported functions) * information

[go-nuts] Re: Doing "C-like" things in Go

2017-09-18 Thread as
There's always a way to write confusing code in any language. var a,b int = 10,20 for a != 0 { do_something() } On Monday, September 11, 2017 at 5:07:48 PM UTC-7, Jon Jenkins wrote: > > I am a C developer and am trying to pick up Go. > > My question is this. C doesn't "care" about

Re: [go-nuts] Issue with json unMarshall

2017-09-18 Thread as
If your field names match the JSON field names, you don't have to explicitly tag them. On Monday, September 18, 2017 at 6:10:46 AM UTC-7, Anil wrote: > > Thanks alot!! > > On Monday, 18 September 2017 18:38:49 UTC+5:30, Shawn Milochik wrote: >> >> Your struct has all unexported fields. So the

Re: [go-nuts] Doing "C-like" things in Go

2017-09-18 Thread Scott Pakin
On Monday, September 11, 2017 at 7:25:54 PM UTC-6, Michael Jones wrote: > > int(boolvalue) could mean 0 for false and 1 otherwise > bool(intvalue) could mean false for 0 an true otherwise > > quite a useful notion > Yeah, too bad that was shot down years ago (cf. proposal: support int(bool)

[go-nuts] Re: cannot assign 1 values to 2 variables [simple error handling]

2017-09-18 Thread Ângelo Chida
I understand now, thank you all Em segunda-feira, 18 de setembro de 2017 02:06:42 UTC-3, Ângelo Chida escreveu: > > Hi, I'm new in Golang but I'm PHP StackDev since 10 years ago > I'm following this tutorial https://golang.org/doc/articles/wiki/ on how > to build a web app, but I'm stuck on

Re: [go-nuts] cannot assign 1 values to 2 variables [simple error handling]

2017-09-18 Thread Ângelo Chida
Hmmm I understand now, thank you all Em segunda-feira, 18 de setembro de 2017 07:35:56 UTC-3, Elias Naur escreveu: > > Just to expand on Ian's reply: you seem to want to have loadPage return > any errors, similar to what ReaedFile does. If so, you need to declare > loadPage to return two

Re: [go-nuts] Issue with json unMarshall

2017-09-18 Thread Anil
Thanks alot!! On Monday, 18 September 2017 18:38:49 UTC+5:30, Shawn Milochik wrote: > > Your struct has all unexported fields. So the json package can't see them. > You have to capitalize the field names. > -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Issue with json unMarshall

2017-09-18 Thread Shawn Milochik
Your struct has all unexported fields. So the json package can't see them. You have to capitalize the field names. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email

[go-nuts] Issue with json unMarshall

2017-09-18 Thread Anil
package main import "fmt" import "encoding/json" type Rec struct { recordIdstring `json:"recordId"` cpmId string `json:"cpmId"` tpDataType string `json:"tpDataType"` tpData string `json:"tpData"` blockId string `json:"blockId"` } func main() {

Re: [go-nuts] cannot assign 1 values to 2 variables [simple error handling]

2017-09-18 Thread Mhd Shulhan
On 18/09/17 10:00, Ângelo Chida wrote: Hi, I'm new in Golang but I'm PHP StackDev since 10 years ago I'm following this tutorial https://golang.org/doc/articles/wiki/ on how to build a web app, but I'm stuck on some error and can't find anywhere a solution. If you read down into "Data

Re: [go-nuts] cannot assign 1 values to 2 variables [simple error handling]

2017-09-18 Thread Elias Naur
Just to expand on Ian's reply: you seem to want to have loadPage return any errors, similar to what ReaedFile does. If so, you need to declare loadPage to return two values, like so: func loadPage(title string) (*Page, error) And return a nil *Page and the error if ReadFile fails: body, err

Re: [go-nuts] `ltrace` yields "Couldn't find .dynsym or .dynstr in "/proc/*/exe" with binaries generated by "go build *.go"

2017-09-18 Thread Konstantin Khomoutov
On Sat, Sep 16, 2017 at 04:51:00AM +0800, Sen Han wrote: > Thanks for your information. I want to use `ltrace` to find out if the > golang binary is using > the __vdso_clock_gettime_sym with CLOCK_MONOTONIC option for measuring time > interval. > > But it finally turns out currently the `ltrace`