[go-nuts] Go WASM question

2019-10-02 Thread Tad Vizbaras
I have sizable Go WASM application that creates map[string]interface{} and passes to JS or reads from JS library. Go maps do not have predefined key order. But JS has object property order predictable in JavaScript objects since ES2015. Problem: when JS objects are transferred from JS into Go

[go-nuts] Re: Go 1.12 installer on Windows 7 (x64) problem

2019-03-04 Thread Tad Vizbaras
youre-running-windows-7-try-installing-service-pack-1/>. > > > > While it is possible that this is a problem specific to the Go installer, > most likely it is not. So I suggest googling for other people with similar > issues installing other software. > > Good Luck.

[go-nuts] Re: syscall/js: How to pass data from the browser back into Go?

2018-10-05 Thread Tad Vizbaras
Yes, I also use js.Value.String() . I have also looked at TypedArray, but that goes from Go into JS types as well. One example use case would be for calling JS splice function from Go. On Friday, October 5, 2018 at 2:04:01 PM UTC-4, Carl Mastrangelo wrote: > > While trying out the Wasm

[go-nuts] Re: Go Webassembly runs out of memory on Android

2018-09-18 Thread Tad Vizbaras
Thank you. Will wait for official fix for this. Go WASM is nice. I have tried it in number of smaller projects. Ability to have single language on both client and server side is awesome. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Go Webassembly runs out of memory on Android

2018-09-18 Thread Tad Vizbaras
Go Webassembly runs out of memory on Android. Very simple app with just few event handlers. I had to use remote debugger to see console. There is resulting screenshot. Device is Samsung Galaxy S7 edge, model: SM-G935T. Used Go 1.11 windows/amd64. Simply used go build with GOOS=js and

[go-nuts] How to post Form data using Go WASM?

2018-08-27 Thread Tad Vizbaras
I am struggling to get this working. How to post Form data to the web server using Go WASM? Do I use fetch API or XMLHttpRequest? -- 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,

[go-nuts] Re: How to find other packages using this package?

2018-08-17 Thread Tad Vizbaras
Found it: go list -f "{{.ImportPath}} {{.Imports}}" ./... | grep %1 Replace %1 with package you are looking for. Run this at GOPATH root to scan all packages. On Friday, August 17, 2018 at 12:08:48 PM UTC-4, Tad Vizbaras wrote: > > I have a package. Let say a/b/c. How to fin

[go-nuts] How to find other packages using this package?

2018-08-17 Thread Tad Vizbaras
I have a package. Let say a/b/c. How to find what are other packages in my GOPATH using it? I am basically trying to clean up GOPATH from all unused packages installed and downloaded over the years. Finding "dead" packages in GOPATH. Tried go list and go doc but only got list of dependencies:

[go-nuts] Gift wrap errors or not?

2018-03-01 Thread Tad Vizbaras
It has been almost two years since this post: https://dave.cheney.net/2016/06/12/stack-traces-and-the-errors-package What is current best practice? Should I use some package to gift wrap errors in order to get stack trace attached to them? Standard library errors package is really "bare bones".

[go-nuts] Re: public key in pem file to X509.Certificate?

2018-02-01 Thread Tad Vizbaras
Found it. The key is to use function x509.ParseCertificate(block.Bytes) . Code below is not clean but should help anyone looking for a way to parse pem file into x509.Certificate. f, err := os.Open(sn.recpCertFile) if err != nil { log.Fatal(err) } defer f.Close() pubPEM, err :=

[go-nuts] Re: public key in pem file to X509.Certificate?

2018-02-01 Thread Tad Vizbaras
Note: I know how to get to *rsa.PublicKey from pem file. Probably missing something really obvious. On Thursday, February 1, 2018 at 11:07:38 AM UTC-5, Tad Vizbaras wrote: > > How to get X509.Certificate struct from public key in pem file? > > -- You received this message

[go-nuts] public key in pem file to X509.Certificate?

2018-02-01 Thread Tad Vizbaras
How to get X509.Certificate struct from public key in pem file? -- 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

[go-nuts] Re: X509 pem RSA example?

2018-02-01 Thread Tad Vizbaras
I just realized that encryption and signing (optional) has to be done for S/MIME and PKCS7. Does standard library covers this? -- 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,

[go-nuts] Re: X509 pem RSA example?

2018-02-01 Thread Tad Vizbaras
Very helpful. Thanks. Can I use 3DES encryption instead of sha256.New() ? Inside this call: ciphertext, err := rsa.EncryptOAEP(sha256.New(), rng, , secretMessage, label) -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

[go-nuts] X509 pem RSA example?

2018-02-01 Thread Tad Vizbaras
Looking for source code example on how to load private/public key from .pem file. Then use it to encrypt/decrypt/sign using RSA. Standard library examples are too low level. My requirement is rather basic: load pem file and then use various RSA functions. I was looking at rsa.EncryptOAEP but

Re: [go-nuts] Re: Experience Report building OCR in Go

2018-01-18 Thread Tad Vizbaras
Yes, that what I have used. I feel that package https://github.com/pkg/errors is good enough to be in the standard library. At least part of it that does stack trace. In all respects Go worked very well for this project. -- You received this message because you are subscribed to the Google

[go-nuts] Re: Race detector for Windows GUI apps. "go build -race" asks for gcc. Why?

2018-01-17 Thread Tad Vizbaras
Summary: adding *.syso file to main packages directory stops normal race detector enabled build on windows/amd64. This in essence prevents race detection on Windows apps with GUI interface that use binary resources (icons, etc.). -- You received this message because you are subscribed to the

[go-nuts] Race detector for Windows GUI apps. "go build -race" asks for gcc. Why?

2018-01-17 Thread Tad Vizbaras
This is windows/amd64 setup. go build -race works in other scenarios. Example: building console apps. It also works if *.syso file with binary resources (icons, etc.) is NOT in the build directory. Once you place rsrc.syso or any *.syso "go build -race" stops working. There is the output: go

[go-nuts] Re: Experience Report building OCR in Go

2018-01-16 Thread Tad Vizbaras
I used "walk" for prototyping but found it too complex. I do not mean this as criticism. "walk" uses many closures to init controls and get GUI working. This is fine if you are into this style of programming. I find reading "walk" internal code challenging. "walk" was an inspiration. It is

[go-nuts] Re: Experience Report building OCR in Go

2018-01-16 Thread Tad Vizbaras
lready a few >> libs, although some of them are still barebones... >> >> https://github.com/lxn/walk >> https://github.com/andlabs/ui >> >> Of course there are also bindings for gtk and qt. >> >> On Monday, 15 January 2018 22:32:33 UTC+2, Tad

[go-nuts] Experience Report building OCR in Go

2018-01-15 Thread Tad Vizbaras
Experience Report building OCR in Go: http://recoink.com/goreport -- 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

[go-nuts] Re: JSON decoding

2017-12-19 Thread Tad Vizbaras
Looks like I found the solution in https://golang.org/pkg/encoding/json/#Decoder.Decode Example (Stream). This should do it. On Tuesday, December 19, 2017 at 11:11:25 AM UTC-5, Tad Vizbaras wrote: > > > I have this: > > type Runner interface { > TaskName() string > Ru

[go-nuts] JSON decoding

2017-12-19 Thread Tad Vizbaras
I have this: type Runner interface { TaskName() string Run(ctx context.Context) error } type Job struct { Tasks []Runner } 1. I have number of structs that implement Runner interface and get added into slice of Tasks. 2. I use json.Encoder to save Job into JSON file. 3. But when I try to

[go-nuts] Re: How to read multi-page TIFF image?

2017-09-24 Thread Tad Vizbaras
e 1st IFD. > > On Friday, September 22, 2017 at 1:49:47 PM UTC-4, Tad Vizbaras wrote: >> >> No problem reading single page TIFF images using: "golang.org/x/image/tiff". >> >> It works great. >> >> >> Question: how to read multi-page scanned TI

[go-nuts] Re: glog log rotate not working correctly

2017-09-21 Thread Tad Vizbaras
There is also library called lumberjack. It integrates nicely with standard library. quote: `Lumberjack is a Go package for writing logs to rolling files.` https://github.com/natefinch/lumberjack -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] Zero value of the map

2017-04-18 Thread Tad Vizbaras
Thank you for detailed explanation. I find myself never using "var a map[int]int" or similar var like map. Maybe just my limited understanding. But I am glad we end up with map[int]int instead of *map[int]int. -- You received this message because you are subscribed to the Google Groups

[go-nuts] Zero value of the map

2017-04-18 Thread Tad Vizbaras
Making zero value useful is great idea. It works for slice, mutex and many others. var a []int a = append(a, 1) fmt.Println(a) This works and prints: [1] Sadly maps do not seem to have useful zero value. They require call to make() or literal to get to useful state. var a map[int]int a[1] =