template-go

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

README

template-go

Go Reference Go Report Card go-test.yaml

Syopsis

The template-go repository serves as a starting point for new repositories hosting Go code. It also shows best practices that can retro-fit into existing repositories hosting Go code.

Overview

Aspects of the template-go repository:

  1. Badges: Example badges can be seen above.
  2. .github/workflows: GitActions tailored to Go programming.
  3. .github/dependabot.yml Specifications for keeping Go dependencies up-to-date.
  4. Example documentation: Documentation style conducive to the Go Package library.
  5. Dockerfile: Containerizing the Go program.
  6. RPM/DEB builds: Using package.Dockerfile to build RPM and DEB files for installation.
  7. Makefile: Simplifies development lifecycle commands.
  8. Sample code: main.go and examplepackage code examples.
  9. Sample test cases: *_test.go files showing how to write and document test cases.

Development

Build
  1. Identify repository. Example:

    export GIT_ACCOUNT=senzing
    export GIT_REPOSITORY=template-go
    export GIT_ACCOUNT_DIR=~/${GIT_ACCOUNT}.git
    export GIT_REPOSITORY_DIR="${GIT_ACCOUNT_DIR}/${GIT_REPOSITORY}"
    
    
  2. Build the binaries. Example:

    cd ${GIT_REPOSITORY_DIR}
    make build
    
    
  3. The binaries will be found in ${GIT_REPOSITORY_DIR}/target. Example:

    tree ${GIT_REPOSITORY_DIR}/target
    
    
  4. Clean up. Example:

    cd ${GIT_REPOSITORY_DIR}
    make clean
    
    
Test
  1. Run Go tests. Example:

    cd ${GIT_REPOSITORY_DIR}
    make test
    
    
Package
Package RPM and DEB files
  1. Use make target to run a docker images that builds RPM and DEB files. Example:

    cd ${GIT_REPOSITORY_DIR}
    make package
    
    
  2. The results will be in the ${GIT_REPOSITORY_DIR}/target directory. Example:

    tree ${GIT_REPOSITORY_DIR}/target
    
    
Test DEB package on Ubuntu
  1. Determine if template-go is installed. Example:

    apt list --installed | grep template-go
    
    
  2. ✏ Install template-go. Example:

    cd ${GIT_REPOSITORY_DIR}/target
    sudo apt install ./template-go-0.0.0.deb
    
    
  3. Run command. Example:

    template-go
    
    
  4. Remove template-go from system. Example:

    sudo apt-get remove template-go
    
    

Documentation

Overview

The Senzing XXXX module is...

Synopsis

The Senzing XXXX packages are...

Overview

(This page describes the nature of the entire Go module or the top-level command, not an individual package.)

More information at https://github.com/senzing/template--go

Another Header

Lorem ipsum dolor sit amet, consectetur adipiscing elit...

Examples

Examples of use can be seen in the xxxx_test.go files.

Directories

Path Synopsis
The example package is used to...
The example package is used to...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL