[go-nuts] Re: Why is there no standard `uuid` package?

2018-02-08 Thread
It's very reasonable, and as an actual decision, we fork that lib.
I understood that a stability of library is not so problem.

However, as Henry says, default UUID specification is defined on RFC.
Implementing it is useful, isn't it?


2018年2月9日金曜日 12時28分16秒 UTC+9 Dave Cheney:
>
> Your argument that the stdlib grows a uuid package is really a call for 
> stability. “3rd parties cannot provide us the stability we need, so the go 
> team must”. I don’t think that is a fair expectation on the go team, 
> especially as there is no clear standard for what a uuid is (having 
> multiple inplemebtations pushes the discussion into the domain of the 
> python standard library). 
>
> I think your problems would be best solved by forking the uuid library at 
> a revision that works for you, or sponsoring the development of a 
> sufficiently stable uuid library. There is clearly a market for one. 

-- 
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 https://groups.google.com/d/optout.


[go-nuts] Re: Why is there no standard `uuid` package?

2018-02-08 Thread
Thanks you for the opinion.
My colleagues are using satori/go.uuid, with web framework, "goa".
API breaking change broke that package and our team had trouble for 
versioning.
https://github.com/satori/go.uuid/issues/66

I know it is not the problem of the code of uuid generation itself,
but my friends in other companies also had the same problem,
or they create an original generator.
it is just the reinventing the wheel so I asked why go has no standard uuid 
package.

it's sure that defining the default format, but except for large-scaled 
system,
generally you can be satisfied with a plain "securerandom" string, can't 
you?

2018年2月9日金曜日 11時10分52秒 UTC+9 Dave Cheney:
>
> But that’s the problem, who’s default uuid format is chosen? And how to 
> justify this over the other users who want their default to be chosen. 
>
> The answer is as it currently stands, multiple uuid libraries exist 
> outside the standard library. 
>
> Can you tell me, in concrete terms, what are the benefits to you of a (I’m 
> going to assume the one that is compatible with your project) uuid 
> implementation being included in the standard library. 

-- 
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 https://groups.google.com/d/optout.


[go-nuts] Re: Why is there no standard `uuid` package?

2018-02-08 Thread
I agree UUID is vague but supplying "default" UUID generator on the 
standard package is significant.
If you'd like to use advanced ID generator, like snowflake, you can use 
that package.
The problem is there is no stable and de facto standard package of it.

2018年2月9日金曜日 3時17分38秒 UTC+9 Tamás Gulácsi:
>
> Because UUID is both vague (what format should it be stored? With- or 
> without dashes? Where to split?) and over-engineered (host's mac address in 
> the UUID? or use the full-random v4 ?).
> For example I use github.com/oklog/ulid - shorter and time-sortable 
> alternative.

-- 
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 https://groups.google.com/d/optout.


[go-nuts] Why is there no standard `uuid` package?

2018-02-07 Thread
Recently satori/go.uuid took a breaking change of API, and some of 
frameworks which depend on the package.
And google/uuid is unstable.

Why Go doesn't have an official uuid package?
Is there any load map to develop google/uuid and merge it to Go itself?

-- 
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 https://groups.google.com/d/optout.


[go-nuts] Why go does't have NullInt type on database/sql?

2017-10-11 Thread
There are NullInt64 and NullFloat64, but not about NullInt, NullFloat. (or 
NullInt32 etc...)
After scanning from rds, my team always convert them to int, but it seems 
so silly.
What is the reason?

-- 
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 https://groups.google.com/d/optout.


[go-nuts] Re: How do you debug Go itself on VM env or Docker container?

2017-08-18 Thread
Do you know any setting file like Vagrantfile or Dockerfile, which is 
appropriate for this case?

2017年8月18日金曜日 17時50分30秒 UTC+9 Tamás Gulácsi:
>
> Fix your VM?

-- 
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 https://groups.google.com/d/optout.


[go-nuts] How do you debug Go itself on VM env or Docker container?

2017-08-18 Thread
I'm trying to debug and run `./all.bash` with VM or docker, but they don't 
work for several reasons.

On VM, I added box of CentOS and Ubuntu, though, they cancels ./all.bash at 
`hardlink` testing.
And on docker, it also fails cuz of the permission of host directory, which 
includes `src`, so they can't create temporary directories for testing.

How do you debug them without soiling your host environment?

-- 
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 https://groups.google.com/d/optout.


[go-nuts] Re: Cannot decode encrypted private key

2016-10-04 Thread
sorry, referenced line was wrong.
https://github.com/golang/crypto/blob/master/ssh/keys.go#L772

2016年10月5日水曜日 3時07分45秒 UTC+9 高橋誠二:
>
> https://github.com/golang/crypto/blob/master/ssh/keys.go#L751
>
> This line blocks to parse private key, that encrypted and contains the 
> encryption header.
> But is this necessary?
>
> So much keys maybe encrypted and this disturbs to authenticate client for 
> ssh connection in many cases.
> It should alert if you must aware it's insecure to parse encrypted one,
> but just returns error and fails following process is a little bit 
> overkill.
>

-- 
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 https://groups.google.com/d/optout.


[go-nuts] Cannot decode encrypted private key

2016-10-04 Thread
https://github.com/golang/crypto/blob/master/ssh/keys.go#L751

This line blocks to parse private key, that encrypted and contains the 
encryption header.
But is this necessary?

So much keys maybe encrypted and this disturbs to authenticate client for 
ssh connection in many cases.
It should alert if you must aware it's insecure to parse encrypted one,
but just returns error and fails following process is a little bit overkill.

-- 
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 https://groups.google.com/d/optout.


[go-nuts] slice: copy to zero length slice

2016-10-02 Thread
As official doc explains, copy to zero length slice results to be empty.

package main

import "fmt"

func main() {
src := []int{1, 2, 3}
dst := []int{}
fmt.Println(len(dst))
copy(dst, src)
fmt.Println(src)
fmt.Println(dst)
// [1 2 3]
// []

src2 := []int{1, 2, 3}
dst2 := make([]int, len(src))
copy(dst2, src2)
fmt.Println(src2)
fmt.Println(dst2)
// [1 2 3]
// [1 2 3]
}



But it seems unusual, is it should be like following?

package main

import "fmt"

func main() {
src := []int{1, 2, 3}
dst := []int{}
fmt.Println(len(dst))
copy(dst, src)
fmt.Println(src)
fmt.Println(dst)
// [1 2 3]
// [1 2 3]
}


-- 
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 https://groups.google.com/d/optout.