Skip to content

Commit

Permalink
Update/cleanup (#2)
Browse files Browse the repository at this point in the history
* Moving binary to releases.

* Removing vendor dir.

* Updating go.mod

* Adding go.sum

* Updating README.md
  • Loading branch information
jdockerty authored Nov 29, 2020
1 parent 842185b commit 31ca790
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 294 deletions.
21 changes: 5 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# NetBuddy
<img src="https://travis-ci.com/jdockerty/netbuddy.svg?token=xPjFq5JeCTp415MsJdAD&branch=master">

Simple CLI tool for networking related information:
* Addresses contained within a network
* Total address count for a particular subnet mask.
Expand All @@ -7,15 +9,14 @@ Simple CLI tool for networking related information:

Examples are shown below.

This project was also conducted for utilising a CI server to perform tests on new commits on the remote master branch, the choice was made for Travis CI.

## Installation

Executing the commands below will download the repo onto your machine, you can then move the pre-built binary into your bin folder for execution from the terminal.
### With Go installed
Executing the commands below will download the repo onto your machine, build the binary using Go, and then move the binary into your `bin` folder for direct execution from the command-line.

```
git clone https://github.com/jdockerty/netbuddy.git
cd netbuddy/
go build
sudo mv netbuddy /usr/local/bin
```

Expand All @@ -28,15 +29,3 @@ Another example is also for displaying the common services or protocol, such as
<img src="https://github.com/jdockerty/netbuddy/blob/master/READMEimages/showBGPExample.png">


## Go Testing and Travis CI
_This section is for my personal notes_

A small number of tests were completed in the `netbuddy_test.go`, this provides a standardised way to test the return variables from varying functions, ensuring they remain the same across adding other features or refactoring code.

Upon conducting the tests, this has helped in ironing out issues which were overlooked, such as testing the `show service` output with a capitalised input, the initial switch statement was evaluating a `strings.ToLower(var)` input, but the input itself had not been altered to always be lowercase to conform to the keys within the map. This was resolved after noticing it through the unit test response.

Travis CI was setup to provide a way in which automated tests can be continually conducted upon each new commit on the remote master branch. The tests which are run are those which have been written in the corresponding test file and the golangci-lint tool is executed to test for stylistic errors, bugs, and to enforce error checking.

The image below shows the most recent build outcome from running the tests provided.

<img src="https://travis-ci.com/jdockerty/netbuddy.svg?token=xPjFq5JeCTp415MsJdAD&branch=master">
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/jdockerty/NetBuddy
module github.com/jdockerty/netbuddy

go 1.14

Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/apparentlymart/go-cidr v1.0.1 h1:NmIwLZ/KdsjIUlhf+/Np40atNXm/+lZ5txfTJ/SpF+U=
github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc=
Binary file removed netbuddy
Binary file not shown.
19 changes: 0 additions & 19 deletions vendor/github.com/apparentlymart/go-cidr/LICENSE

This file was deleted.

218 changes: 0 additions & 218 deletions vendor/github.com/apparentlymart/go-cidr/cidr/cidr.go

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions vendor/modules.txt

This file was deleted.

0 comments on commit 31ca790

Please # to comment.