diff --git a/.github/workflows/createrelease.yml b/.github/workflows/createrelease.yml new file mode 100644 index 0000000..65ea96f --- /dev/null +++ b/.github/workflows/createrelease.yml @@ -0,0 +1,40 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: Create Release + +on: + release: + types: [created] + +permissions: + contents: write + packages: write + +jobs: + releases-matrix: + name: Create Release + runs-on: ubuntu-latest + strategy: + matrix: + goos: [linux, windows, darwin] + goarch: [amd64] + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.21.2' + + - name: Create Release + uses: wangyoucao577/go-release-action@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + goversion: "https://go.dev/dl/go1.21.2.linux-amd64.tar.gz" + project_path: "./cmd" + binary_name: "ip-scanner" + extra_files: LICENSE README.md configs data diff --git a/common/utils.go b/common/utils.go index 322aa81..a37c697 100644 --- a/common/utils.go +++ b/common/utils.go @@ -114,6 +114,7 @@ func printResult(scanRecords ScanRecordArray, config *Config) { if len(head) > 10 { head = head[:10] } + fmt.Printf("%s\t%s\t%s\t%s\n", "IP", "Protocol", "PingRTT", "HttpRTT") for _, record := range head { fmt.Printf("%s\t%s\t%f\t%f\n", record.IP, record.Protocol, record.PingRTT, record.HttpRTT) }