Skip to content

Convert from bash script to Go application #57

@mcdonnnj

Description

@mcdonnnj

💡 Summary

We should look at converting this project from a bash script to a Go application.

Motivation and context

Writing the extension in Go would provide a number of benefits:

  • More direct integration with the gh utility through the go-gh module.
  • Better versioning because using the gh-extension-precompile action will provide the correct scaffolding to create releases that gh will work with instead of a git pull.
  • Real testing because it would be significantly easier to test the components of a Go application with proper unit testing and go test.

Implementation notes

Since we archived our Go package skeleton we do not have a better skeleton to inherit from at present. As such we should probably organize the application as a basic command using multiple files. This will allow us to break up functionality as needed without adding needless complexity through internal packages to import.

We should target the latest two releases per the Go Release Policy and make sure we can build binaries for all major platforms (Linux, macOS, Windows) on the most common architectures (amd64 and arm64)..

All functionality should have tests to ensure expected functionality. Unit tests and gomock can be used to ensure test coverage.

Acceptance criteria

  • Bash script (./gh-skeleton) has been converted to a Go application that successfully builds for all major platforms (Linux, macOS, Windows).
  • All existing functionality of the bash script is implemented.
  • All functionality has test coverage.
  • Releases are built using the gh-extension-precompile action.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions