[go-nuts] Re: [CGO] How can I convert GoString to wchar_t?

2020-09-27 Thread peterGo
Sean, Some fixes and improvements. Copy the demonstration program code and run on a Windows machine. wchar.go: https://play.golang.org/p/0npllLM7Uhz Here are the Tolk and UTF16 wrappers: func WCharPtrToString(p *C.wchar_t) string { return windows.UTF16PtrToString((*uint16)(p)) } func WCha

[go-nuts] Re: Traversing AST with type information?

2020-09-27 Thread Daniel T. Gorski
On Sunday, 27 September 2020 at 20:46:19 UTC+2 Glen Mailer wrote: > I'm playing about with some go tooling, and I wanted to parse a package > with type information to inspect it and derive some insights from the data. > [...] > I can't seem to find a way to inspect the resolved AST along with typ

Re: [go-nuts] Traversing AST with type information?

2020-09-27 Thread Glen Mailer
I think I'm now starting to get the hang of traversing around and looking up type info as needed now. Are there any higher level libraries around which make navigating the ASTs easier? I'm finding I need to do a lot of conditional casts, which doesn't help the signal:noise ratio of my functions

Re: [go-nuts] Traversing AST with type information?

2020-09-27 Thread 'Dan' via golang-nuts
On Sun, 2020-09-27 at 11:45 -0700, Glen Mailer wrote: > > Hello! > > I'm playing about with some go tooling, and I wanted to parse a > package with type information to inspect it and derive some insights > from the data. > > I found the packages tool - > https://godoc.org/golang.org/x/tools/go/

[go-nuts] Re: [CGO] How can I convert GoString to wchar_t?

2020-09-27 Thread peterGo
Sean, Go strings are UTF-8 encoded. Windows Unicode strings are UTF-16 encoded and null-terminated. The Go Windows port uses the Win32API DLLs for OS services. It has much of the code you need. Here is a working (Windows 10, MinGW64) demonstration program which provides Tolk and UTF16 wrappers

Re: [go-nuts] Re: Go API receive calls twice when hit through browser

2020-09-27 Thread smartaq...@gmail.com
Thanks a lot. It is working now. After giving the API link it is making the request to the specified one only. Thank you for the help. On Sunday, 27 September 2020 at 22:45:01 UTC+5:30 iko...@gmail.com wrote: > mind: there are more well-known locations, they are just not as common as > the favi

[go-nuts] Traversing AST with type information?

2020-09-27 Thread Glen Mailer
Hello! I'm playing about with some go tooling, and I wanted to parse a package with type information to inspect it and derive some insights from the data. I found the packages tool - https://godoc.org/golang.org/x/tools/go/packages - which on the surface appears to be exactly what I wanted.

Re: [go-nuts] Re: Go API receive calls twice when hit through browser

2020-09-27 Thread Joop Kiefte
mind: there are more well-known locations, they are just not as common as the favicon call, so you might just want to be specific on where you expect your API calls and only listen on that. [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=pb5kd) [pb5kd]

Re: [go-nuts] Re: Go API receive calls twice when hit through browser

2020-09-27 Thread Joop Kiefte
probably the best solution is to use the handlers and not listen on any other link than your API links, then the favicon request won't hit your service. You don't even really have to return a 200, just make sure you don't answer to favicon.ico requests the very least. [Joop Kiefte - Chat @ Spi

Re: [go-nuts] Re: Go API receive calls twice when hit through browser

2020-09-27 Thread smartaq...@gmail.com
Thank you for the reply. Is there anyway to stop it completely or its the default behavior of all the browsers. It is an api and not any web page due to which adding a meta tag is not possible i think so. I've checked on google, and people are just returning a 200 status, when browser ask for