[go-nuts] Using log Package with log.Lshortfile Flag

2018-04-11 Thread Kaveh Shahbazian
The code resides here . The output from the program is: NaClMain [ info ] 23:00:00 main.go:13: main.main started NaClMain [ info ] 23:00:00 main.go:13: main.compute1 started NaClMain [ info ] 23:00:00 main.go:13: main.compute2 started NaClMain [ info ]

Re: [go-nuts] gocql date field conversion issue

2018-04-11 Thread Henrik Johansson
There is a PR for `date` marshalling https://github.com/gocql/gocql/pull/878 that is merged March last year. If you have gocql older than that I suggest trying to update but I am not sure if it helps. Timestamp/time.Time has always worked very well for me though so if you can switch that could be

[go-nuts] Re: Using log Package with log.Lshortfile Flag

2018-04-11 Thread Ayan George
On Wednesday, April 11, 2018 at 5:31:55 AM UTC-4, Kaveh Shahbazian wrote: > > The code resides here . > > The output from the program is: > > NaClMain [ info ] 23:00:00 main.go:13: main.main started > NaClMain [ info ] 23:00:00 main.go:13: main.compute1

[go-nuts] Re: Using log Package with log.Lshortfile Flag

2018-04-11 Thread Kaveh Shahbazian
The first function inflog.Println is not even being called. It is being passed to the function tract as an argument. And the result of function trace is being sent to another call to function inflog.Println. The result of function trace is a struct which has a String method and the the String

[go-nuts] gocql date field conversion issue

2018-04-11 Thread Raju
I have a table in cassandra which looks like this: create table dailyusage( name string service string date date ); I need to write a query in Go using gocql package to filter the results from dailyusage table based on a user provided date range I have created my query like this

[go-nuts] [NEWBIE] what means importing a file versus a directory?

2018-04-11 Thread Robert P. J. Day
total beginner question here, but the docs seem vague or inconsistent on what should be a simple question -- what does it mean to import a name that is a single .a file versus importing a directory name from under GOROOT (in my case, on fedora, /usr/lib/golang). first, running on fedora 28

Re: [go-nuts] [NEWBIE] what means importing a file versus a directory?

2018-04-11 Thread Jan Mercl
On Wed, Apr 11, 2018 at 3:21 PM Robert P. J. Day wrote: > ... -- what does it mean > to import a name that is a single .a file versus importing a directory > name from under GOROOT (in my case, on fedora, /usr/lib/golang). You mostly cannot really import a file and

Re: [go-nuts] [NEWBIE] what means importing a file versus a directory?

2018-04-11 Thread Ian Lance Taylor
On Wed, Apr 11, 2018 at 6:11 AM, Robert P. J. Day wrote: > > total beginner question here, but the docs seem vague or > inconsistent on what should be a simple question -- what does it mean > to import a name that is a single .a file versus importing a directory > name

Re: [go-nuts] net.Conn not returning error upon Write after being closed from far side.

2018-04-11 Thread pierspowlesland
Hi Alex Thanks for your suggestion, I have implemented it, but something is still not quite right, the first iteration of the loop to write to the conn still encounters a temporary error, even though the internal error is a syscall.ECONNRESET. Please see the updated code below func

[go-nuts] alternate struct tags for json encode/decode?

2018-04-11 Thread Reed Wade
More than once, I've found myself wanting to do something like this: package main import ( "encoding/json" "os" ) type Cake struct { Muffin string `json:"muffin" json2:"muffin"` Piestring `json:"pie" json2:"-"` Tuna string `json:"tuna" json2:"eel"` } func main() { c := Cake{"a",

[go-nuts] Re: Language is a platform, which golang still does not pay attention to !!!

2018-04-11 Thread Reed Wade
So -- Go's fatal flaw is you can just deploy your code and run it instead of having to first install heaps of libs and config and maybe a jvm first? I'm certain that's not what was meant but that's how this reads. I guess the "I don't use Go" bit is the telling part. It doesn't look complex

Re: [go-nuts] alternate struct tags for json encode/decode?

2018-04-11 Thread Jan Mercl
On Wed, Apr 11, 2018 at 2:50 PM Reed Wade wrote: > Is there a sensible existing way to do that? Would this be a useful update to the lib? Not very nice, but: https://play.golang.org/p/gkWEuV1AlwB -- -j -- You received this message because you are subscribed to the

Re: [go-nuts] [NEWBIE] what means importing a file versus a directory?

2018-04-11 Thread Robert P. J. Day
On Wed, 11 Apr 2018, Ian Lance Taylor wrote: > On Wed, Apr 11, 2018 at 6:11 AM, Robert P. J. Day > wrote: > > > > total beginner question here, but the docs seem vague or > > inconsistent on what should be a simple question -- what does it mean > > to import a name that

Re: [go-nuts] net.Conn not returning error upon Write after being closed from far side.

2018-04-11 Thread pierspowlesland
Hi Janne I don't think that is the problem since the problem persists even after inserting a 4 second wait between closing the connection from the far side and writing to the near side. On Tuesday, April 10, 2018 at 5:02:32 PM UTC+1, Janne Snabb wrote: > > Your TCP FIN is still in transit or

Re: [go-nuts] [NEWBIE] what means importing a file versus a directory?

2018-04-11 Thread andrey mirtchovski
> ah, it's all (i think) clear now. so, based on what i see under > ${GOROOT}/src/hash, i could do any or all of the following: > > import "hash" > import "hash/adler32" > import "hash/crc32" > import "hash/crc64" > import "hash/fnv" note that you don't need to import "hash" unless

[go-nuts] Re: Anyway to print the exact cql query being executed against db

2018-04-11 Thread Raju
Thanks, Lee. I will give it a try -Raju On Wednesday, April 11, 2018 at 8:39:57 AM UTC-7, Lee Painton wrote: > > I have not tried this yet, but if you set up a > https://godoc.org/github.com/gocql/gocql#QueryObserver on your session I > believe you can get exhaustive metrics including the

[go-nuts] Re: Anyway to print the exact cql query being executed against db

2018-04-11 Thread Lee Painton
I have not tried this yet, but if you set up a https://godoc.org/github.com/gocql/gocql#QueryObserver on your session I believe you can get exhaustive metrics including the executed statement. On Wednesday, April 11, 2018 at 12:42:28 AM UTC-4, Raju wrote: > > By the way, I am using gocql

Re: [go-nuts] net.Conn not returning error upon Write after being closed from far side.

2018-04-11 Thread Alex Efros
Hi! On Wed, Apr 11, 2018 at 07:35:50AM -0700, pierspowlesl...@gmail.com wrote: > So I believe I have found the source of this problem. A method Temporary is > defined on syscall.Errno, for a reason that is unclear to me ECONNRESET and > ECONNABORTED are considered temporary. I would definitely

Re: [go-nuts] net.Conn not returning error upon Write after being closed from far side.

2018-04-11 Thread pierspowlesland
So I believe I have found the source of this problem. A method Temporary is defined on syscall.Errno, for a reason that is unclear to me ECONNRESET and ECONNABORTED are considered temporary. I would definitely consider those errors permanent. func (e Errno) Temporary() bool { return e ==

Re: [go-nuts] [NEWBIE] what means importing a file versus a directory?

2018-04-11 Thread Robert P. J. Day
On Wed, 11 Apr 2018, andrey mirtchovski wrote: > > ah, it's all (i think) clear now. so, based on what i see under > > ${GOROOT}/src/hash, i could do any or all of the following: > > > > import "hash" > > import "hash/adler32" > > import "hash/crc32" > > import "hash/crc64" > > import

Re: [go-nuts] gocql date field conversion issue

2018-04-11 Thread Raju
Hi Henrik, Thanks for the reply. I do see that code in marshal.go in my gocql repo. So I should be having this specific PR. case TypeDate: return unmarshalDate(info, data, value) case TypeDate: return marshalDate(info, value) And the corresponding func implementations are also there.

Re: [go-nuts] Re: Anyway to print the exact cql query being executed against db

2018-04-11 Thread Lee Painton
No problem. Let me know how it works out, I'm going to try it myself sometime next week. On Wed, Apr 11, 2018 at 11:42 AM, Raju wrote: > Thanks, Lee. I will give it a try > > -Raju > > > On Wednesday, April 11, 2018 at 8:39:57 AM UTC-7, Lee Painton wrote: >> >> I have not

Re: [go-nuts] net.Conn not returning error upon Write after being closed from far side.

2018-04-11 Thread Ian Lance Taylor
On Wed, Apr 11, 2018 at 7:35 AM, wrote: > > So I believe I have found the source of this problem. A method Temporary is > defined on syscall.Errno, for a reason that is unclear to me ECONNRESET and > ECONNABORTED are considered temporary. I would definitely consider

[go-nuts] where would one find "go tool tour" with fedora-installed pkgs?

2018-04-11 Thread Robert P. J. Day
more sophomoric questions -- following along on the go tour: https://tour.golang.org/welcome/3 which suggests that, after i install go, i can run: $ go tool tour on my fedora 28 beta system: $ go tool tour go tool: no such tool "tour" $ should i have expected this? is there a

Re: [go-nuts] net.Conn not returning error upon Write after being closed from far side.

2018-04-11 Thread Alex Efros
Hi! On Wed, Apr 11, 2018 at 10:19:21AM -0700, Ian Lance Taylor wrote: > You might want to open an issue about this. Done: https://github.com/golang/go/issues/24808 -- WBR, Alex. -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] alternate struct tags for json encode/decode?

2018-04-11 Thread Reed Wade
oh, cool! I had no idea that was doable (makes sense in retrospect but..). That would kind of suit a lot of the cases I care about. thanks, -reed On Thursday, 12 April 2018 00:57:20 UTC+12, Jan Mercl wrote: > > On Wed, Apr 11, 2018 at 2:50 PM Reed Wade > wrote: > >

[go-nuts] Re: [NEWBIE] what means importing a file versus a directory?

2018-04-11 Thread peterGo
Robert, First, read, The Go Programming Language Specification https://golang.org/ref/spec Packages https://golang.org/ref/spec#Packages Peter On Wednesday, April 11, 2018 at 9:22:04 AM UTC-4, Robert P. J. Day wrote: > > > total beginner question here, but the docs seem vague or >

[go-nuts] Re: where would one find "go tool tour" with fedora-installed pkgs?

2018-04-11 Thread peterGo
Robert, On Ubuntu, I ran, $ go get -v -u golang.org/x/tour/... $ gotour Please file a complaint about the missing instructions: https://github.com/golang/go/issues. Peter On Wednesday, April 11, 2018 at 1:46:51 PM UTC-4, Robert P. J. Day wrote: > > > more sophomoric questions -- following

Re: [go-nuts] alternate struct tags for json encode/decode?

2018-04-11 Thread Timothy Raymond
It wasn’t always possible. I think this ability was added around 1.8 to expressly make multiple “views” of a struct easier by ignoring tags in the identity of the struct: https://go-review.googlesource.com/c/go/+/30169 -- You received this message because you are subscribed to the Google

Re: [go-nuts] Re: Good Cyclomatic Complexity Number for Go

2018-04-11 Thread diego . zoracky
Cyclomatic complexity can be helpful in keeping us away from writing complex code that can be more error prone, more complex to be tested and harder to reason about. I would give a special attention for the latter one as it implies in low readability and high maintenance costs. For example, an

[go-nuts] ThreadSanitizer: DenseSlabAllocator overflow. Dying.

2018-04-11 Thread cousins via golang-nuts
Can someone please provide some guidance in finding the root-cause of this little chestnut, please? I've a codebase within which all tests pass when run locally on Mac OS X, but when verified on Linux, we see: ThreadSanitizer: DenseSlabAllocator overflow. Dying. Both cases see the same code,