Re: [go-nuts] Choosing a framework

2017-09-12 Thread Sam Whited
Here is a list of useful components that I sometimes reach for when I need to do something in HTTP land that requires that I leave the comfort and safety of the standard library but don't want to get locked into a "framework". There may be better implementations of some of these, but the ones liste

Re: [go-nuts] Re: Confusion about C++ calling go

2017-09-12 Thread wolfkdy1989
thanks. 在 2017年9月13日星期三 UTC+8上午1:22:35,Ian Lance Taylor写道: > > On Tue, Sep 12, 2017 at 9:52 AM, > > wrote: > > > > To be precise, I want to know if the garbage-collection thread still > runs if > > the program is started from C++ main-entry. > > I think a pure golang program will start the

Re: [go-nuts] [urgent] the right way of using Blowfish decryption?

2017-09-12 Thread Jason Wang
Thanks for the clue. I googled about the ECB mode, and wrote a implementation in Go. It works now. Sadly to know this is vulnerable. This decryption method exists in the system for a long time. I was just starting working on it. So, not much can I do to correct it. On Wednesday, September 13,

[go-nuts] Re: Running multiple iterations of "go test" in a single process, to allow for cumulative coverage results

2017-09-12 Thread Ugorji Nwoke
never mind - I figured it out. On Tuesday, September 12, 2017 at 6:08:27 PM UTC-4, Ugorji Nwoke wrote: > > I currently use command line parameters to test that various options work > fine. > > For example, I define some test flags like -tv -ta -ti ... that set > different options on my test, an

[go-nuts] Running multiple iterations of "go test" in a single process, to allow for cumulative coverage results

2017-09-12 Thread Ugorji Nwoke
I currently use command line parameters to test that various options work fine. For example, I define some test flags like -tv -ta -ti ... that set different options on my test, and then run my tests. The execution looks like this: go test -tv go test -ti go test -ta ... Unfortunately, I can

[go-nuts] locking memory pages

2017-09-12 Thread Ganesh Sangle
We have written a server in golang, and the requirement is that this server should be as responsive and the process should never be swapped out. To enable this we added: err = syscall.Mlockall(syscall.MCL_CURRENT | syscall.MCL_FUTURE) The resulting behavior seems that top shows RES memory always

Re: [go-nuts] Re: Confusion about C++ calling go

2017-09-12 Thread Ian Lance Taylor
On Tue, Sep 12, 2017 at 9:52 AM, wrote: > > To be precise, I want to know if the garbage-collection thread still runs if > the program is started from C++ main-entry. > I think a pure golang program will start the gc-thread before the 'func > main(){}' but I don't know if it still holds true if

Re: [go-nuts] [urgent] the right way of using Blowfish decryption?

2017-09-12 Thread Jesper Louis Andersen
It is very likely that ECB mode is the culprit here because Blowfish is a 64bit cipher and thus uses an 8-byte blocksize. However, Go's crypto/cipher doesn't have ECB mode. And for good reason: it is a quite dangerous mode to use in general (A good example is on the wikipedia page for it, for inst

[go-nuts] Re: Confusion about C++ calling go

2017-09-12 Thread wolfkdy1989
To be precise, I want to know if the garbage-collection thread still runs if the program is started from C++ main-entry. I think a pure golang program will start the gc-thread before the 'func main(){}' but I don't know if it still holds true if the golang-part is only a static-library. 在 201

[go-nuts] Confusion about C++ calling go

2017-09-12 Thread wolfkdy1989
By using cgo, I wrappered some complex code written by golang into a static-lib and call into the lib from C++. My question is: the process will run from a c++ main-entry. Will golang's gc-background thread work in this way? I'm worried that the entry is from C++ code and golang's vm-environment

[go-nuts] [urgent] the right way of using Blowfish decryption?

2017-09-12 Thread Jason Wang
I have a python function: import from Crypto.Cipher import Blowfish import binascii def decrypt_password(encode): key = 'aa11k55544332211aabbaabbaaddccbb' blowfish = Blowfish.new(key, Blowfish.MODE_ECB) packed_password = blowfish.decrypt(binascii.unhexlify(encode)) return pac

Re: [go-nuts] Possible bug in golang type checker

2017-09-12 Thread Jan Mercl
On Tue, Sep 12, 2017 at 4:19 PM wrote: > Is that a bug in the golang type checker or am i missing something. An instance of A implements A because it _is_ A. C embeds A so C implements A. B embeds *C so B implements A. -- -j -- You received this message because you are subscribed to the Goo

[go-nuts] Possible bug in golang type checker

2017-09-12 Thread jonathan . hurter
Hi ! Today i found a weird thing in the Golang type checker. I have a package with the following architecture: type A interface { > D() > } > > type B struct { > *C > } > > func (t B) NotD() {} > > type C struct{ > A > } > And when i did: > var _ A = (*B)(nil) > I excpected th

Re: [go-nuts] if condition in html template

2017-09-12 Thread ivo . hechmann
Thank you very much. Indeed, it would be clean to use Objects instead of simple Strings to flag if a dump can be restored or not. I've added the function strings.Contains before parsing the template-files: templates, err = template.New("").Funcs(template.FuncMap{ "Contains": strings.C

Re: [go-nuts] Doing "C-like" things in Go

2017-09-12 Thread Konstantin Khomoutov
On Mon, Sep 11, 2017 at 09:56:59AM -0700, CampNowhere wrote: > I am a C developer and am trying to pick up Go. > > My question is this. C doesn't "care" about truthfulness, it just cares > about zero and non-zero when evaluating a logical AND operator. So > something like the following in C is t

[go-nuts] Re: net: unclear how to confirm synchronously that a net.TCPListener is closed

2017-09-12 Thread Dave Cheney
On Tuesday, 12 September 2017 17:56:19 UTC+10, Shivaram Lingamneni wrote: > > > > On Tuesday, September 12, 2017 at 1:35:43 AM UTC-4, Dave Cheney wrote: >> >> >> >> On Tuesday, 12 September 2017 15:23:56 UTC+10, Shivaram Lingamneni wrote: >>> >>> So this proves it: "happens-after Listener.Close()

[go-nuts] new ndk and gomobile

2017-09-12 Thread Ged Wed
i just noticed this: https://android-developers.googleblog.com/2017/09/introducing-android-native-development.html The latest version of the NDK is less unorthodox. Wondering what impact this might have on gomobile for Android, if anyone has some insight on this. -- You received this message b

Re: [go-nuts] A question about evaluation of channel’s send statement

2017-09-12 Thread Konstantin Khomoutov
On Wed, Sep 06, 2017 at 04:26:09AM -0700, T L wrote: > > > It is just weird that the evaluation timing of *p is different to other > > expressions, such as, *p+0, *p*1, func()int{return *p}m etc. > > > > The value depends on a data race so it's entirely undefined in all cases. > > That the actu

[go-nuts] Re: net: unclear how to confirm synchronously that a net.TCPListener is closed

2017-09-12 Thread shivaram
On Tuesday, September 12, 2017 at 1:35:43 AM UTC-4, Dave Cheney wrote: > > > > On Tuesday, 12 September 2017 15:23:56 UTC+10, Shivaram Lingamneni wrote: >> >> So this proves it: "happens-after Listener.Close()" is not a sufficient >> condition for being able to rebind the address. If another gor