[go-nuts] My trouble about GO interface

2018-08-08 Thread Ally Dale
Hi everyone, I have some confusion about GO's interface: 1. Some different interface but with the same signature I have put an example here: https://github.com/vipally/glab/blob/master/lab12/walk_test.go The confusion is, there are two different interface filepath.Walker and pet.Walker. filepath.

[go-nuts] Why GO do not have implemetion of algorithm ECIES

2018-09-11 Thread Ally Dale
Hi everyone, I'm interesting in why GO do not have implemention of algorithm ECIES. As another kind of PKI algorithm ,EC family has much less key length and supplies more strenth of security to compare with RSA. I want to know if GO team has plans of ECIES or has any suggestions about that? Ally

[go-nuts] encoding/json: add FlexObject for encoding/decoding between JSON and flex Go types.

2021-05-09 Thread Ally Dale
reffer issue ## Sometimes we have to deal with JSON that with unknown data types. Such as [sample JSON](https://github.com/vipally/glab/blob/master/lab27/json_test.go#L9) below: ``` [ { "kind":"dog", "attr":{ "type":"Col

[go-nuts] Re: encoding/json: add FlexObject for encoding/decoding between JSON and flex Go types.

2021-05-09 Thread Ally Dale
sage `json:"attr"` } // Animal can only used to generate sample JSON type Animal struct { Kind string `json:"kind"` Attr interface{} `json:"attr"` } ``` 在2021年5月10日星期一 UTC+8 上午3:14:45 写道: > On Sunday, 9 May 2021 at 13:30:59 UTC+1 Ally Dale w

[go-nuts] Does anyone konw which proposal changes the access for embeded field name of struct?

2021-06-07 Thread Ally Dale
Does anyone konw which proposal changes the access for embeded field name of struct? Eg: ``` type Base struct{ Name string } type Value struct{ Base } ``` We initial a Value as: var v = Value{ Base: Base{ Name:"xxx", } } instead of var v = Value{ Name:"xxx", } I

Re: [go-nuts] Does anyone konw which proposal changes the access for embeded field name of struct?

2021-06-07 Thread Ally Dale
t composite literals. > > On Mon, Jun 7, 2021 at 11:20 AM Ally Dale wrote: > >> Does anyone konw which proposal changes the access for embeded field name >> of struct? >> Eg: >> ``` >> type Base struct{ >> Name string >> } >> ty

Re: [go-nuts] Does anyone konw which proposal changes the access for embeded field name of struct?

2021-06-07 Thread Ally Dale
7, 2021 at 2:47:07 AM UTC-7 axel.wa...@googlemail.com > wrote: > >> What we are saying is that you are misremembering. That's not how Go ever >> worked. >> >> On Mon, Jun 7, 2021 at 11:36 AM Ally Dale wrote: >> >>> As far as I remember(may

[go-nuts] cmdline--improve Golang std.flag based on Go src v1.7

2016-08-18 Thread Ally Dale
Hi, everyone, I have create a package named cmdline to extend std.flag based on Go src v1.7 Then, we can make a command usage page more easily and with enough information. So, I wonder if the Go authors can merge this change into std.flag, to help gophers make a command line page mo

[go-nuts] Re: cmdline--improve Golang std.flag based on Go src v1.7

2016-08-19 Thread Ally Dale
ding. You might also want to re-visit the "usage" > function convention since that's pretty easy to use to accomplish the > "enough information" part. > > On Thursday, August 18, 2016 at 6:11:35 AM UTC-4, Ally Dale wrote: >> >> Hi, everyone, >>

[go-nuts] Re: cmdline--improve Golang std.flag based on Go src v1.7

2016-08-19 Thread Ally Dale
ding. You might also want to re-visit the "usage" > function convention since that's pretty easy to use to accomplish the > "enough information" part. > > On Thursday, August 18, 2016 at 6:11:35 AM UTC-4, Ally Dale wrote: >> >> Hi, everyone, >>

[go-nuts] Re: cmdline--improve Golang std.flag based on Go src v1.7

2016-08-19 Thread Ally Dale
ding. You might also want to re-visit the "usage" > function convention since that's pretty easy to use to accomplish the > "enough information" part. > > On Thursday, August 18, 2016 at 6:11:35 AM UTC-4, Ally Dale wrote: >> >> Hi, everyone, >>

[go-nuts] std.flag require noname-flag support

2016-09-12 Thread Ally Dale
Hi all, I found that std.flag require noname-flag support. For example: "ping 127.0.0.1 -n 2" and "ping 127.0.0.1 /n 2" are legal windows "ping" command line usages, but std.flag does not support these formats. Moreover, I found std.flag has a suspect BUG: I think "ping 127.0.0.1 -n = 2" or "pin

[go-nuts] os.Getwd() returns path separated with "\" in windows troubles me

2016-09-23 Thread Ally Dale
Golang std library such as path.Split() all suppose path is separated with "/". But os.Getwd() get a path separated with "\" such as "D:\temp" in windows. That does troubled gophers to deal with os.Getwd() return path by golang std library. So could go authers fix this case to let os.Getwd() ret

Re: [go-nuts] os.Getwd() returns path separated with "\" in windows troubles me

2016-09-23 Thread Ally Dale
I think I know what the mistake is, thanks a lot. 在 2016年9月24日星期六 UTC+8上午1:33:58,Ian Lance Taylor写道: > > On Fri, Sep 23, 2016 at 8:54 AM, Ally Dale > wrote: > > Golang std library such as path.Split() all suppose path is separated > with > > "/". > >

[go-nuts] type-embeded consts and variables request

2016-09-25 Thread Ally Dale
Hi all, I want to know why Golang do not have type-embeded consts or variables (Just like static values and method build-in classes in object oriented languages like C++) This feature helps us define type-shared valuse, and do not increase size of instanced objects. Unfortunately Golang do not h

Re: [go-nuts] type-embeded consts and variables request

2016-09-26 Thread Ally Dale
think this code may make the clients crazy... 在 2016年9月26日星期一 UTC+8上午12:21:55,Jan Mercl写道: > > On Sun, Sep 25, 2016 at 6:07 PM Ally Dale > > wrote: > > > Exactly, I desired my extension code can be like this: > type Duration time.Duration > const Duration.Day = D

Re: [go-nuts] type-embeded consts and variables request

2016-09-26 Thread Ally Dale
ond = 1000 * Millisecond Minute = 60 * Second Hour = 60 * Minute } And let the enum members use as raw-consts. Can assign to any type that has the corresponding well-known types? 在 2016年9月26日星期一 UTC+8下午5:06:18,Ally Dale写道: > > I think that is not a good idea. > First of all, I

Re: [go-nuts] type-embeded consts and variables request

2016-09-27 Thread Ally Dale
our own package. No need to > define a new type. > > On Mon, Sep 26, 2016 at 11:17 AM, Ally Dale > wrote: > >> In final words, the KEY problem of my topic is: >> It's easy to extending exists public types by redefine or use struct's >> no-name embeding in Gola

[go-nuts] cmdline's first release(support no-name and synonyms flags)

2016-09-30 Thread Ally Dale
Hi guys, It's glad to recommend that my cmdline project has published it's first release: 2.0.0.final. You can find the project here: https://github.com/vipally/cmdline It's normally to support a command line style like this: ping [-4=] [-c|count=] [-t|ttl=] [] Main feature change from std.flag:

[go-nuts] A full GP solution of golang——"gogp" 3.0.0.final released

2016-10-07 Thread Ally Dale
Hello, everyone, It is my pleasure to announce that my GP solution of golang——"gogp" has published its final release: 3.0.0.final. You can find the project here: https://github.com/vipally/gogp This project was born from January 2014. This is the final release unless there are more good ideas or G

[go-nuts] A full-feature serialization package to replace std.binary released.

2017-10-20 Thread Ally Dale
Hello, everyone, It's my pleasure to announce that I have just released a stable version of full-feature serialization package to replace std.binary. You can find the project here: https://github.com/vipally/binary My trouble is that when I want to transport a go data on network between golang ap

[go-nuts] Re: A full-feature serialization package to replace std.binary released.

2017-10-20 Thread Ally Dale
Thanks for suggestion, I have change license to MIT 在 2017年10月20日星期五 UTC+8下午3:53:52,Dave Cheney写道: > > Thank you for sharing your package. Would you consider re-licencing it > under a more permissive licence like MIT or BSD? > > On Friday, 20 October 2017 17:37:07 UTC+10,

[go-nuts] My trouble of local package referencing

2017-11-16 Thread Ally Dale
Hi all, I was confused that why golang do not support referencing local package. eg: import "./local2" //error: local import "./local2" in non-local package I have upload a test project here: https://github.com/vipally/localpackage Here is my trouble: My project path is: github.com/vipally/localpa

Re: [go-nuts] My trouble of local package referencing

2017-11-16 Thread Ally Dale
that's a good thing; it's not a distributable package. If you > are doing the first kind of fork, you have to change the import paths to > the new identity, but that's a good thing: You are clearly saying, which of > the two, now distinct packages, you need. > > &g

Re: [go-nuts] My trouble of local package referencing

2017-11-18 Thread Ally Dale
entify; so if you change the identity, change the name too and if you > don't want to change the name, don't be surprised that you can't just coopt > some other packages identity. > > On Fri, Nov 17, 2017 at 7:54 AM, Volker Dobler > wrote: > >> On Friday

Re: [go-nuts] My trouble of local package referencing

2017-11-19 Thread Ally Dale
together. 4. "#/xxx" style reference seems a best solution like "vendor" to fix local-package reference problem. Without any hard code "where I am" exists in any go files. And it will works well together with current global-style, because "#" will be replaced wi

[go-nuts] why fmt "%#v" and "%#q" of string value have different result

2017-12-06 Thread Ally Dale
Hi, I was confused that why fmt "%#v" and "%#q" of string value have different result. fmt.Printf("%#q\n", `%#q: "c:\x\y\z"`) fmt.Printf("%#v\n", `%#v: "c:\x\y\z"`) fmt.Printf("%#q\n", "%#q cannot sharp because has [``] ") fmt.Printf("%#v\n", "%#v cannot sharp because has [``] ") // `%#q: "c

[go-nuts] How can I get unix timestamp(time.Now().Unix()) in linker(cmd/link)

2017-12-15 Thread Ally Dale
Hi all, I just need a function to report the timestamp when my app compiled. func main() { unix := runtime.BuildTimestamp() t := time.Unix(unix, 0) println("hello world") println("buildtimestamp:", unix) println("buildtime :", t.String())

Re: [go-nuts] How can I get unix timestamp(time.Now().Unix()) in linker(cmd/link)

2017-12-17 Thread Ally Dale
0,Ian Lance Taylor写道: > > On Fri, Dec 15, 2017 at 3:08 AM, Ally Dale > wrote: > > Hi all, > > I just need a function to report the timestamp when my app compiled. > > > > func main() { > > > > > > unix :=

[go-nuts] readonly []byte required

2019-07-04 Thread Ally Dale
[]byte is mutable in Go, but string is readonly, so []byte(string) in Go is actually allocate&memcopy, and this operation is costly. Sometimes, we need a readonly []byte parameter but we have string only, and we have no choice but allocate&memcopy to make a new []byte variable from string. Eg: n