Best Practices in Go GUI Development

The Go language has well-defined practices for formatting, documentation, and code structure. You can find these referenced in many places, for example, https://golang.org/doc/effective_go.html#formatting and https://github.com/golang/go/wiki/CodeReviewComments. Additionally, there is a strong community drive to encourage writing idiomatic Go, such as https://dmitri.shuralyov.com/idiomatic-go. Many of these design decisions are encoded in tools such as gofmt and golint, which makes it easy for people to learn and maintain standardized code.

In this chapter, we will look beyond these code standards and common conventions to focus on the aspects of best practice that make it easier to maintain and grow GUI-based applications. We will cover the following topics:

  • Separation of concerns
  • Test-driving UI development
  • Continuous integration for GUIs
  • Managing platform specifics

The addition of graphical elements to an application often makes it harder to test. In this chapter, we will see that with the correct preparation and structure, we can overcome these challenges and make our code robust and easy to change. Let's start by looking at how to structure a GUI-based application for maintainability.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.166.149