[go-nuts] Re: Go JIT

2024-04-09 Thread 'Mihai' via golang-nuts
Maybe http://golang.org/pkg/types and http://golang.org/pkg/build can help you. On Tuesday, April 9, 2024 at 2:04:03 AM UTC+3 Carl-Philip Hänsch wrote: > Hi, > > I saw in go's source code that all methods and data structures regarding > parsers, the IR and so on are private. > > Is there a way

Re: [go-nuts] Convert html text to pdf using go language .

2024-04-09 Thread 'Mihai' via golang-nuts
Use princexml command line using https://pkg.go.dev/os/exec . There is no native Go package to render html into pdf. The issue is very complicated because both HTML and CSS (and potentially JS) are complex markup language and as no browser was ever written in Go nobody will write HTML and CSS

[go-nuts] Re: using interface{} values in C/C++ bindings

2024-04-09 Thread Mihai Barbu
>>yes, Is there any library code in golang that helps me to read out interface{}'s type information? Yes, there is https://golang.org/pkg/reflect For example: getType(0) getType("hello string") func getType(v interface{}){ t := reflect.TypeOf(v) fmt.Printf("type is %s", t) } On Tuesday,

[go-nuts] Is it possible to "extract" the generic [T] from a reflected type ?

2024-04-09 Thread Mihai Barbu
I need to call some generic functions with types that are now known at compile time. Is it possible to do this? See the code below (vastly reduced). // fv is a function that returns an unknown type func Do(fv reflect.Value){ // get the first returned type by function fv vt :=

[go-nuts] Re: Go WebAssembly(wasm) testing fails - fatal error: unexpected signal during runtime execution

2019-11-14 Thread mihai barbulescu
the code which causes this crash ? > - Which Go version are you using ? > - Are you testing this in the browser or in Node ? Please give details of > either. > > > > On Thursday, 14 November 2019 18:52:49 UTC+5:30, mihai barbulescu wrote: >> >> I'm building a client-

[go-nuts] Re: wasm - Browser gets stuck due memory usage

2019-11-10 Thread mihai barbulescu
It seems in the end the issue was actually a deadlock in the event loop. I fixed it by spawning go routines on all the functions interacting with the dom. --- > > I'm trying to build a web/client app using Go (compiled to wasm). The > issue is that the browser(both

Re: [go-nuts] Re: v1.13: Altered go.mod file in project after updating vim-go binaries

2019-09-05 Thread Mihai Borobocea
On Thu, Sep 5, 2019 at 10:18 PM Jan Mercl <0xj...@gmail.com> wrote: > `go get` should do just one thing and do it well. Automagically > adjusting `go.mod` if one is found in the current directory (or in any > of its parents) when outside $GOPATH is IMO neither of that. Or it > should be enabled by

Re: [go-nuts] Re: v1.13: Altered go.mod file in project after updating vim-go binaries

2019-09-05 Thread Mihai Borobocea
nds have well defined behavior. But it is not a small topic/scenario, so getting a sense of how things work takes some effort and experimentation. Mihai -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

Re: [go-nuts] Re: How to update a module's direct dependencies only

2019-09-05 Thread Mihai Borobocea
On Thu, Sep 5, 2019 at 3:28 PM Tamás Gulácsi wrote: > Ain't Go 1.13's "go get -u" does exactly this? > And the old behaviour with "go get -u all" ? > Thanks for the input but: > I cannot use 'go get -u -t -d ./...' here because that brings in the >> indirect dependency 'goB' into my go.mod. >>

Re: [go-nuts] Re: How to update a module's direct dependencies only

2019-09-05 Thread Mihai Borobocea
f GitHub issues about upgrading to /v2+ (like changing the /vN import suffix automatically) once the user knows about a new major version. But I didn't find an issue about discovering that there is a new major version without manually checking. Regards, Mihai -- You received this message becau

[go-nuts] Re: gomobile - SIGPIPE

2018-02-12 Thread mihai
. 3. Put the application in background (press the "stand by/lock-in" button) 4. Get it out of background (i.e. unlock the phone) 5. You get SIGPIPE https://github.com/themihai/testios gomobile version gomobile version +5704e18 Mon Jan 22 17:02:51 2018 + (android,ios); androidS

[go-nuts] gomobile - SIGPIPE

2018-02-05 Thread mihai
I'm trying to develop a gomobile application using a http server serving html and a swift client serving the content from localhost through a WKWebView. All the work happens inside the http handlers(i.e. http requests to external API servers). The issue is that after several requests the

Re: [go-nuts] Breaking change: reflect.StructOf: field 0 has no name

2017-12-11 Thread mihai
Is there any reason why this breaking change is not mentioned in any of the release notes? On Monday, December 11, 2017 at 8:22:28 AM UTC+2, Ian Lance Taylor wrote: > > On Sun, Dec 10, 2017 at 8:46 AM, wrote: > > > > I had some code that I didn't touch for a while and now it

[go-nuts] Breaking change: reflect.StructOf: field 0 has no name

2017-12-10 Thread mihai
panics now and my question is why is a struct field without a name invalid ? Anonymous fields are supposed to have no field names, right? https://github.com/golang/go/issues/20600 Mihai. -- You received this message because you are subscribed to the Google Groups "golang-nuts&q

[go-nuts] reflect, is it possible to get the [body + sign] of a func as text at runtime ?

2016-09-18 Thread 'Mihai B' via golang-nuts
The body is compiled so you can't get it via reflection. -- 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

[go-nuts] Interface{} constrains on specific types

2016-06-24 Thread 'Mihai B' via golang-nuts
I'm developing a json schema generator (json schema from Go ast and the other way around). There is a keyword "oneOf" which requires exactly one schema to be valid in this keyword's value. In Go I translate it by using an empty interface{}. The issue is that when I convert the interface{} to

[go-nuts] Unmarshalling and tags

2016-06-19 Thread 'Mihai B' via golang-nuts
/selectors would be a bad idea. Another option would be to use a standard tag key as default (e.g. "encoding") but I think it may violate the Go1 backward compatibility. Mihai. [0] type Payment struct { ActionType paypal.ActionType `query:"actionType,omitempty" json:"a

[go-nuts] WebAssembly as a target

2016-06-19 Thread 'Mihai B' via golang-nuts
I don't think we can expect anything before wasm supports GC (i.e. Phase 3 on wasm roadmap). Once GC is supported(not very soon) Go could be compiled through llgo[0]. One issue could be the binary size(.i.e due /reflect) - Mihai [0] https://llvm.org/svn/llvm-project/llgo/trunk/README.TXT