[go-nuts] get Package from types.Type

2019-02-15 Thread Randall O'Reilly
I’m probably missing something very basic, but I have a go/types.Type and I want to find which package it was defined in. I can get the path of the Package using TypeString but somehow I can’t seem to figure out how to get the *Package itself! I can’t find a “lookup package by path” and

[go-nuts] Go and Microsoft Outlook

2019-02-15 Thread Andrew
Our corporate using Outlook send/receive emails. I have some emails need to send out routinely with the same content(book truck, ask for order information, etc). I want to write a simple web app with some buttons on the page(Book Truck, for example), when I click the button, I want to send the

[go-nuts] Go 2 generics, yet another view

2019-02-15 Thread 'Константин Иванов' via golang-nuts
Hi, all. Here is my view on Go 2 generics https://gist.github.com/logrusorgru/091282900712443ca78bbce0a71e41cc Please review and leave a feedback. I just want to share my thoughts on this. Nothing serious. -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] why go get does not work outside a module?

2019-02-15 Thread Tyler Compton
It sounds to me like you would want to set GO111MODULE to "auto". My understanding is that then "go get" will behave like it used to when run inside of the GOPATH or in a directory tree without a go.mod file. Here's a bit of information about it on the wiki:

[go-nuts] Re: tidy - a super simple source code sorting tool

2019-02-15 Thread Louki Sumirniy
yeah it is really rough... it splits blocks occasionally such that a block lacks its final bracket, it ends up somewhere else. but it doesn't happen that often that it's hard to manually correct at this point. I am thinking now after seeing the greatly improved visual appeal of my code when

[go-nuts] Re: tidy - a super simple source code sorting tool

2019-02-15 Thread Louki Sumirniy
ok never mind the combining files thing... doesn't work yet :) and I'm sure the manual cleanup will be super messy On Friday, 15 February 2019 22:34:19 UTC+1, Louki Sumirniy wrote: > > oh, I really didn't introduce that so well... > > I fixed the issue about multiple init/main functions by

[go-nuts] Re: tidy - a super simple source code sorting tool

2019-02-15 Thread Louki Sumirniy
oh, I really didn't introduce that so well... I fixed the issue about multiple init/main functions by setting it to count how many it finds and just leaving them where they are if there is more than one (they will just end up in arbitrary order next to each other within the func block for this

[go-nuts] tidy - a super simple source code sorting tool

2019-02-15 Thread Louki Sumirniy
I have written a small source code processing tool which does something that I personally think that gofmt should do. It's called tidy, and it's hiding inside the embryonic attempt at a 'deal with all those irritating application setup startup stuff' project here:

[go-nuts] Re: inverse of time.Duration?

2019-02-15 Thread Louki Sumirniy
time.Duration is nanoseconds. You can easily get any other unit by dividing by the time.Timeunit by another time unit.(time.Minute time.Second, time.Millisecond, time.Microsecond) If that 1 in your formula means time.Second then you could just replace it with that, and 5.671ms would be equal

Re: [go-nuts] inverse of time.Duration?

2019-02-15 Thread Hemant Singh
Thanks all. I figured it out too, but using sprintf and strconv.Atoi. Best. Hemant On Friday, February 15, 2019 at 3:19:38 PM UTC-5, Burak Serdar wrote: > > On Fri, Feb 15, 2019 at 1:15 PM Sam Whited > wrote: > > > > On Fri, Feb 15, 2019, at 20:00, Burak Serdar wrote: > > >

Re: [go-nuts] inverse of time.Duration?

2019-02-15 Thread Burak Serdar
On Fri, Feb 15, 2019 at 1:15 PM Sam Whited wrote: > > On Fri, Feb 15, 2019, at 20:00, Burak Serdar wrote: > > rate=1.0/double(dur) > > nit: s/double/float64/ oops. Thanks for the correction. > > —Sam > > -- > You received this message because you are subscribed to the Google Groups >

Re: [go-nuts] inverse of time.Duration?

2019-02-15 Thread Sam Whited
On Fri, Feb 15, 2019, at 20:00, Burak Serdar wrote: > rate=1.0/double(dur) nit: s/double/float64/ —Sam -- 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

Re: [go-nuts] inverse of time.Duration?

2019-02-15 Thread Burak Serdar
On Fri, Feb 15, 2019 at 12:49 PM Hemant Singh wrote: > > This is an example of time.Duration I have: 5.671msec > > I need to convert the duration to rate = 1.0/5.671 msec. > > However, time.Duration and float in 1.0 do not mix. How do I get the rate? According to the docs, Duration is

Re: [go-nuts] inverse of time.Duration?

2019-02-15 Thread Michael Jones
start := time.Now() : // work to be timed : elapsed := time.Now().Sub(start).Seconds() hertz := 1.0/elapsed On Fri, Feb 15, 2019 at 11:49 AM Hemant Singh wrote: > This is an example of time.Duration I have: 5.671msec > > I need to convert the duration to rate = 1.0/5.671 msec. > > However,

[go-nuts] Weekend question: Idiomatic way of handling >millions of objects (structs ;))

2019-02-15 Thread Jeroen Massar
Hi folks, Silly question time, to get to the most idiomatic golang based solution... In C, when I have a large collection of structs with data (no pointers outbound), I would just mmap a large file and chunk up the file into the size of the struct, basically thus doing a bit of memory

[go-nuts] Anyone ever used Flogo.io ?

2019-02-15 Thread 'Jerome Dardant' via golang-nuts
Hi, I am trying to see if a lot of people are using it in France in order to animate a group. Thanks, Jérôme -- 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

Re: [go-nuts] Re: Handling connection retries on a highly-available service

2019-02-15 Thread n . curin
Hey, I'm a dev on this project, I'll provide a few explanations about this topic : I don't get it. Why are they supposed to be dropped only because the > logging service is down? > We're calling this a "logger" but it's not as you'd think ; the data being transmitted is subject to GDPR and

[go-nuts] Re: What is the future of go mod vendoring?

2019-02-15 Thread 'Bryan Mills' via golang-nuts
Vendoring support in 1.13 is currently under discussion at https://golang.org/issue/30240. TL;DR: I'm hoping to better integrate it with the module workflow. (It's not going away in the foreseeable future.) On Friday, February 15, 2019 at 5:05:14 AM UTC-5, Amnon Baron Cohen wrote: > > >

[go-nuts] Re: Question for "net" package experts

2019-02-15 Thread John Dreystadt
Ah, thanks. Now I understand, the need was to distinguish the value. I wonder if there might be some way to document this a bit better. Not a high priority but I will see if I can come up with anything. -- You received this message because you are subscribed to the Google Groups "golang-nuts"

[go-nuts] chicken and egg problem with go mod replace

2019-02-15 Thread Manlio Perillo
Hi. I have a project A (github.com/perillo/a) and a project B (github.com/perillo/b). A depends on B, but B is not still on github. Both projects live on the same directory on my disk. I tried to add a replace directive to go.mod: replace github.com/perillo/b => ../b however go build fails

[go-nuts] why go get does not work outside a module?

2019-02-15 Thread Manlio Perillo
I have started to use go modules recently, and I have set GO111MODULE=on. It was unexpected to found that go get does not work outside a module. As an example: $ go get github.com/davecheney/godoc2md go: cannot determine module path for source directory /home/manlio (outside GOPATH, no import

[go-nuts] Re: loop - Help

2019-02-15 Thread afriyie . abraham
hi, currently am able to get the vlaues but will like to get both key and values, how will i be able to do it. This is output i got now, a slice of the apiVersionInUri", which is corent but want it with the keys, like "apiVersionInUri": "http://instance4.com";, map form [

[go-nuts] Re: loop - Help

2019-02-15 Thread afriyie . abraham
hi, This is what i have done so far but still need some help as to how to return ""v.APIVersionInURI" in the loop function (FindAlluris()) . Am trying to write a function which will return all the field ""v.APIVersionInURI" in the mongo db and then use this function in my API handler function.

[go-nuts] Re: What is the future of go mod vendoring?

2019-02-15 Thread Amnon Baron Cohen
https://github.com/golang/go/wiki/Modules#how-do-i-use-vendoring-with-modules-is-vendoring-going-away On Thursday, 14 February 2019 02:26:35 UTC, Paul A. Fortin wrote: > > I have heard that the vendir dirctory is here to stay and also that it is > going away - can someone from the goteam give us