Thanks for the replies.
Sameer: it would be awesome if you can open source them.
Thanks,
Rajanikanth
On Thu, Jul 20, 2017, 7:47 PM Sameer Ajmani wrote:
> We have a few implementations of this inside Google (expiring.Map,
> timedcache, and lru.Cache). It might make sense to open source these,
We have a few implementations of this inside Google (expiring.Map,
timedcache, and lru.Cache). It might make sense to open source these, if
they have no internal dependencies.
On Wed, Jul 19, 2017 at 3:22 PM Rajanikanth Jammalamadaka <
rajanika...@gmail.com> wrote:
> Does somebody have a recomme
On Thu, Jul 20, 2017 at 2:50 PM, Helton Marques wrote:
>
> Yeah, I now, but considering these proposal:
> https://github.com/golang/go/issues/20757
> This function (IsZero) would not bring even more reliable use ?
Sure, if we adopt proposal #20757 we may well need or at least want an
IsZero metho
Yeah, I now, but considering these proposal:
https://github.com/golang/go/issues/20757
This function (IsZero) would not bring even more reliable use ?
Em quinta-feira, 20 de julho de 2017 22:12:04 UTC+2, Ian Lance Taylor
escreveu:
>
> On Thu, Jul 20, 2017 at 1:02 PM, Helton Marques > wrote:
>
On Mon, Jul 17, 2017 at 11:07 AM wrote:
> does it make sense to consider a "value type of any type that carries out
> its input type" ?
>
Yes. This is called a "universal" and is related to the concept of
parametrization by J. Reynolds.
Your 'do' function is often called 'id' for the obvious re
On Thu, Jul 20, 2017 at 1:02 PM, Helton Marques wrote:
>
> There's some reason to not have the function `IsZero` to time.Duration ?
>
> IMO, I think this can be useful:
>
>
> ```
> type Server struct { timeout time.Duration `yaml:"timeout:"` }
> ...
> if srv.timeout.IsZero() { srv.timeout = defaul
There's some reason to not have the function `IsZero` to time.Duration ?
IMO, I think this can be useful:
```
type Server struct { timeout time.Duration `yaml:"timeout:"` }
...
if srv.timeout.IsZero() { srv.timeout = defaultServerTimeout }
```
Anyone knows if there's some restriction to not h
I see your point.
I might checkout going bare database/sql on one of my smaller projects to get a
feel for it - now that I’ve been thinking about it it strikes me that I’ve
actually never tried database stuff on Go without gorp/gorm etc.
--
Michael Banzon
https://michaelbanzon.com/
> Den 2
Again, I'm mostly for generics being added to Go, because I've found
occasion where they would be useful...
On Thursday, July 20, 2017 at 6:40:00 AM UTC-7, M P r a d e s wrote:
>
> Go could have least have parametric functions (ex :
>
> func Foo(value T)T { /.../ }
>
> bar := Foo(3) //types are v
The main reason is to avoid magic. My past experience with ORMs has been
that they make easy things easier and hard things harder. Once you start
leveraging relational bits, they become incredibly unwieldy to actually
use. They also tend to generate wildly suboptimal SQL and rely on a lot of
That makes sense, thank you! It does make it a little confusing that a
special case was made for pointers to arrays that violates that rule, but
it's a pretty rare use case anyway.
Thanks for pointing this out, it was driving me crazy.
On Thursday, July 20, 2017 at 2:47:12 AM UTC-4, Lyuben Blag
Hi Sofiane,
Answering the "what type" question is pretty much unavoidable.
You can embed that forking logic inside the "on the fly" function, like in
Roger's example (using a switch v := v.(type) construct) or you can use
reflect.
Alternatively, you can group your transformation functions into
Thats a great resource, thank you!
Also does the htttptest.Server mock out a server so that you can test
clients?
What if I want to test my own server?
On Wednesday, July 19, 2017 at 10:07:44 AM UTC-7, Jérôme LAFORGE wrote:
>
> One of my favorite resource can be found here about testing server
In func Foo(value T)T { /.../ }
It makes sense to anchor the definition of T to the func name.
I feel like it is not needed, and i wonder about multiple T parameters.
Where the question here is about
func Foo(x , y ) (, ){}
Or
func Foo(x t, y u) (t, u){}
At least, it is possible to say your v
Go could have least have parametric functions (ex :
func Foo(value T)T { /.../ }
bar := Foo(3) //types are verified at compile time, no need for
reflection or interface {} on any runtime trick.
).
But talking about this is kind of useless until Go rids itself of its over
reliance on runtime f
On Thu, 20 Jul 2017 03:08:58 -0700 (PDT)
"'Florian Uekermann' via golang-nuts" wrote:
> The go tool does not provide a way to update
> dependencies of packages that are not go get-able.
Yes it is. Go tooling is based on and has a convention to follow. Hence there
is no support for "place pieces
I'm not convinced that holding all your values in a uniform way
is going to be that helpful for you. You might be better using reflection
to map the columns into a struct type (there's probably a package
out there already that can do that).
However, to answer without questioning the whole premise:
See my previous answer to ohir for a less convoluted and less specific
problem statement. My problem does not seem to be related to being inside
or outside a GOPATH.
> Dependencies are derived from import paths. Import paths are not complete
> paths. They are transformed to complete paths by
Thanks for the suggestions. I may not have explained the setup well enough.
I don't think your suggestions work if you just have your code in a folder
without any additional structure (no src directory).
But your first suggestion prompted my to play around with having the
package in a GOPATH and
We use it, but due to working with a legacy schema we've had to make
some internal changes to it to ensure we get decent go structures.
You can see the sort of things we've really quickly hacked into it, not
had time to upstream, here:
https://github.com/stevenh/xo/commits/mysql-primary-keys
Hi Silviu,
Thanks for the reply.
Basically I want to kinda functional map on my custom types by applying
functions on base value or struct values.
What if I want to for instance:
- Multiply the float64 value inside CSVFloat by 2 ?
- or Replace a custom type value with another one from the same
21 matches
Mail list logo