webview / webview_go

Go language bindings for the webview library.
MIT License
176 stars 27 forks source link

Add Go binding #1

Closed SteffenL closed 10 months ago

SteffenL commented 10 months ago

Part of the work for splitting Go binding from core webview library.

See the following issue:

ttytm commented 10 months ago

What about using a script to pull the header files? - stupidly asked, as there might be a good reason you include them.

SteffenL commented 10 months ago

The headers were copied in because there's no way to pull in external non-Go code such as C/C++ headers with a normal Go workflow. It's a fight against Go tooling that I don't believe we can win.

We've been imposing manual steps or scripts onto Go users. It isn't a nice experience for users. I wrote a Go generator that pulls in headers but it requires users to also manually run the generator. I've tried vendoring but it requires us to sprinkle Go-related files in the repository of the core library which means it isn't much better than leaving the Go bindings there. Oh, and vendoring also requires users to opt into using vendoring (for all of their Go dependencies, not just webview).

This PR accepts the downside of copying headers in order to put an end to the clumsy process we put users through.

ttytm commented 10 months ago

Yes security issues make it not justifiable to automatically run a generator.

I think running go generate once after installing the package is a simple enough process to not a be a blocker. But it's neither a deal breaker to copy the headers to the lib. So the reasoning is understandable, thanks for the explanation :+1: