Live data from Hacker News

Air – Live reload when developing with Go

github.com

21–30 of 46 posts

Re: Air – Live reload when developing with Go

#21
post #5

When writing go, I've always found if I find myself constantly restarting & recompiling a program during development, it means that I should be writing tests instead.

Suppose you want to instrument some code that touches a database, because you suspect some data (in prod) is coming off the database that is messing your assumptions up, but you don't know yet what specific assumption it is.

Because it's just a gut feeling, you can't write a test against it

Re: Air – Live reload when developing with Go

#22

Useful tool, but it has some bugs related to consecutive build failures. Restarting Air is required to fix it. I still use it, just wish I didn't have to restart it frequently.

Air also needs be restarted if you're switching git branches and there are a lot of changes between the branches

Re: Air – Live reload when developing with Go

#24
post #5

When writing go, I've always found if I find myself constantly restarting & recompiling a program during development, it means that I should be writing tests instead.

Does live-reload that runs tests exist?

this is just a fancy description for a basic rollout system.

Re: Air – Live reload when developing with Go

#25
post #5

When writing go, I've always found if I find myself constantly restarting & recompiling a program during development, it means that I should be writing tests instead.

Does live-reload that runs tests exist?

If you write your tests with Ginkgo [0] its CLI can do this for you.

It also has nice facilities to quickly disable a test or portion of a test by prepending an X to the test function name, or to focus a test (only run that test) by prepending an F. It’s pretty nice.

[0]: https://onsi.github.io/ginkgo/

Re: Air – Live reload when developing with Go

#26
post #5

When writing go, I've always found if I find myself constantly restarting & recompiling a program during development, it means that I should be writing tests instead.

How would you write the tests to see if the RTL text is being displayed properly on the GUI when switching between LTR and RTL layout mode?

How would you write the tests to see if the GLSL shader is displaying the mesh on the screen with the correct gamma correction factor?

Re: Air – Live reload when developing with Go

#27
post #5

When writing go, I've always found if I find myself constantly restarting & recompiling a program during development, it means that I should be writing tests instead.

Does live-reload that runs tests exist?

Yes, on .NET, Visual Studio Enterprise.

https://docs.microsoft.com/en-us/visualstudio/test/live-unit...

Re: Air – Live reload when developing with Go

#29
post #26
post #5

When writing go, I've always found if I find myself constantly restarting & recompiling a program during development, it means that I should be writing tests instead.

How would you write the tests to see if the RTL text is being displayed properly on the GUI when switching between LTR and RTL layout mode? How would you write the tests to see if the GLSL shader is displaying the mesh on the screen with the correct gamma correction factor?

Given go's nature of being more network oriented, I think these questions are a bit disingenuous.

Go comes with a lot of facilities for testing the things it's good at.

If testing GLSL shaders, or gui applications is difficult, I'd consider putting at least some pressure on the tooling providers to provide better testing facilities.

I'm more familiar with how opengl & shaders work than I am with text rendering - so I'll keep my commentary towards the shader question. At least on the surface it seems de-composable into two distinct problems: Is the shader emitting the correct colors after gamma correction is applied, and is that rendering appearing on the screen.

The former could be tested by rendering to a buffer and capturing the output, and asserting against an expected color value.

The latter is where I'd say that better tooling is indeed required.

Re: Air – Live reload when developing with Go

#30
post #26
post #5

When writing go, I've always found if I find myself constantly restarting & recompiling a program during development, it means that I should be writing tests instead.

How would you write the tests to see if the RTL text is being displayed properly on the GUI when switching between LTR and RTL layout mode? How would you write the tests to see if the GLSL shader is displaying the mesh on the screen with the correct gamma correction factor?

I lnow you're saying that when it comes to GUIs you have to do it manually, but as someone working on the back-end this begs the question: is there no unit tests framework or anything for GUIs ?
Post reply on HN