[go-nuts] Re: Go if else syntax .. suggested replacement

2019-04-28 Thread whitehexagon via golang-nuts
imo a very important aspect of a language is enduring syntax stability. Too many 'modern' languages lack even the most fundamental requirement of a solid Language Specification. Well done Go! And love or hate Java, that's what made it stable enough for it's massive and enduring success. Go

[go-nuts] Re: built-in alternative to bcrypt?

2019-04-23 Thread whitehexagon via golang-nuts
Don't get me wrong, I strongly believe in storing user data safely, and especially passwords, hence my original question. But as I mentioned, I'm basically trying to protect a customers email address at this point. So if the attack vector I'm defending against is someone having direct access

[go-nuts] Re: built-in alternative to bcrypt?

2019-04-22 Thread whitehexagon via golang-nuts
Thanks everyone, plenty more reading for me! I'm also pleased to discover the increasing binary size isn't being ignored by the team :) especially since I'm also planning some more Go WASM stuff (although currently I switched to Java WASM for exactly this reason for that part of the

[go-nuts] Re: Working outside of VCS - parent/child modules

2019-04-22 Thread whitehexagon via golang-nuts
Thank you for taking the time for a thoughtful response, it's good to get some context about why things are as they are. Previously I have worked in large organisations were most projects were using a single repo for a given project, with multiple projects spread across many departments. So a

[go-nuts] built-in alternative to bcrypt?

2019-04-22 Thread whitehexagon via golang-nuts
I'm porting some code over to Go, and currently looking at some password hashing. I'm wondering if there is a 'standard library' alternative to using bcrypt? I am concerned about the Go binary size, since I'm already at 15MB! So I'm trying to limit external dependencies as much as possible.

[go-nuts] Working outside of VCS - parent/child modules

2019-04-20 Thread whitehexagon via golang-nuts
https://github.com/golang/go/wiki/Modules#can-i-work-entirely-outside-of-vcs-on-my-local-filesystem For a simple parent/child module relationship this seems to work, since the 'replace' work-around is in the parent go.mod. But when the childA depends on childB, then the 'replace' directive in

Re: [go-nuts] Pointer based API and constants literals, how to best handle it?

2019-04-18 Thread whitehexagon via golang-nuts
Sure, I'm still learning Go, so it's probably more idiotic than idiomatic, but help yourself: https://github.com/WhiteHexagon/go2aws Peter On Thursday, 18 April 2019 18:03:05 UTC+2, Jim Ancona wrote: > > Is your Cognito provider open source? I might have a use for that/ > > Jim > > -- You

Re: [go-nuts] Pointer based API and constants literals, how to best handle it?

2019-04-17 Thread whitehexagon via golang-nuts
Thanks Jim, and for the sympathy :) I'm almost tempted to use the REST API and bypass the SDK... I already implemented a missing Cognito Provider using the web API, and it seemed friendlier than this. It would be one less dependency too, since I'm deploying to AWS Lambda and I'm already at

[go-nuts] Pointer based API and constants literals, how to best handle it?

2019-04-17 Thread whitehexagon via golang-nuts
I'm still very new to Go, so apologies if this is obvious. I'm porting some code over to Go, and the provided SDK I'm working with seems to want pointers everywhere. However a lot of the values are constant / literals. So for example storing some data in the DB:

[go-nuts] Re: Go wasm - package js - Set() fails for certain attributes

2019-03-30 Thread whitehexagon via golang-nuts
I haven't done much client side javascript, but I'm used to seeing 'class' and 'onClick' as attributes on a div or button. Strange that no errors were generated anywhere, but anyway, both tips work perfectly, Thanks!! Peter On Saturday, 30 March 2019 20:28:56 UTC+1, Rusco wrote: > > If you

[go-nuts] Go wasm - package js - Set() fails for certain attributes

2019-03-30 Thread whitehexagon via golang-nuts
So I create a html button, and try to set some attributes, some work, some fail, is there a reason for this? but := doc.Call("createElement", "button") but.Set("id", bID) //works but.Set("innerHTML", "Don't Panic") //works but.Set("title", "mybuton") //works but.Set("class",

[go-nuts] Re: wasm output and modules

2019-03-29 Thread whitehexagon via golang-nuts
I took out the Funcs for now, but no difference. But good point about the signal! I currently dont have an exit button, Although I figure most people just close a tab, or close the browser, so I guess I need to find a way to make that work without an explicit button...? or maybe they just hit

[go-nuts] Re: wasm output and modules

2019-03-27 Thread whitehexagon via golang-nuts
Thanks. So those flags knocked about 100kB off the size down to 2.5MB. But it seems Kotlin generates a similar sized file ~2.6MB maybe for a similar reason i.e. runtime jvm. I also tried gzip as suggested on the wiki, but my hosting provider always delivers the full file :( But anyway my

[go-nuts] wasm output and modules

2019-03-26 Thread whitehexagon via golang-nuts
I know that the Go wasm support is still experimental, although it seems to be working great here! :) but are there any tools for pruning the .wasm output? I'm only using about 3 pkg imports but end up with a 2.6MB .wasm file. I've seen the suggestion for using tinygo, but I didnt get that

Re: [go-nuts] what +build flags do I need to distinguish between ios and macos please?

2019-03-23 Thread whitehexagon via golang-nuts
ah yes thanks, amd64, it was late :) So if I build a shared lib, it might be running in the emulator, on a device, or on my mac... I found some code referencing ios, does this look valid? // +build ios,darwin,amd64 // +build ios,darwin,arm64 ios,darwin,arm // +build !ios,darwin,amd64 Peter

[go-nuts] local module rename causing build errors looking for previous module name

2019-03-23 Thread whitehexagon via golang-nuts
Bit of a strange one... I created a new module this morning, and just renamed the directory, module and associated package (all the same). I have a sub module (package main) that references the parent module, but we are talking about a dozen lines of code in the whole project so far. So 'go

[go-nuts] non-local return?

2019-03-08 Thread whitehexagon via golang-nuts
I'm really liking in Go that I can easily pass bits of code around, 'closures'? Apologies if I have terminology wrong, since I'm new here. For a typical asynchronous bit of code I like to pass in a 'func' for what to do with the result, and also a 'func' to handle any errors. I'm struggling

Re: [go-nuts] Re: OpenAL and microphone on macos using the mobile pkg

2019-03-08 Thread whitehexagon via golang-nuts
Ah of course, it has to rebuild per target platform. Looking further at the mobile API I'm not sure it includes the Capture part of OpenAL anyway. I'll have a look at kotlin-native for this part of my functionality. Thank you for your help. Peter On Friday, 8 March 2019 10:36:41 UTC+1,

[go-nuts] Re: OpenAL and microphone on macos using the mobile pkg

2019-03-07 Thread whitehexagon via golang-nuts
Thanks! That got me some steps further down the rabbit hole :) gomobile: the Android requires the golang.org/x/mobile/exp/audio/al, but the OpenAL libraries was not found. Please run gomobile init with the -openal flag pointing to an OpenAL source directory. So first I tried 'brew reinstall

[go-nuts] OpenAL and microphone on macos using the mobile pkg

2019-03-07 Thread whitehexagon via golang-nuts
go1.12 macos 10.12.4 I haven't been able to find a Go example of this being used so far. However I found a C example that I'm porting over to Go that access the microphone. All I'm doing so far is 'al.OpenDevice()' running 'gomobile build' generates this error:

[go-nuts] Go cross-platform opengl ES2 GUI

2019-03-06 Thread whitehexagon via golang-nuts
Go 1.12 package: golang.org/x/mobile Based on the 'basic' example I got something running quite easily on Android. iOS was slightly harder, since it was appending 'ProductName' to my bundleId, but I worked around that by creating a provisioning profile '.ProductName'. Also 'gomobile: rename