Skip to content

Commit f7cc2b1

Browse files
committed
refactor: clean up GoReleaser configuration and improve command flag descriptions
1 parent c516c13 commit f7cc2b1

6 files changed

Lines changed: 37 additions & 22 deletions

File tree

.github/workflows/goreleaser.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ jobs:
1717
with:
1818
go-version: 1.23.2
1919

20-
2120
- name: Clean dist directory
2221
run: rm -rf dist
2322

.goreleaser.yaml

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,45 @@
1+
version: 2
2+
13
before:
24
hooks:
35
- go mod tidy
4-
- go generate ./...
6+
57
builds:
6-
- env:
7-
- CGO_ENABLED=0
8-
goos:
9-
- linux
10-
- darwin
11-
- windows
12-
goarch:
13-
- amd64
14-
- arm64
8+
- env:
9+
- CGO_ENABLED=0
10+
goos:
11+
- windows
12+
- linux
13+
- darwin
14+
goarch:
15+
- amd64
16+
- 386
17+
- arm
18+
- arm64
19+
20+
ignore:
21+
- goos: darwin
22+
goarch: '386'
23+
- goos: windows
24+
goarch: 'arm'
25+
26+
binary: '{{ .ProjectName }}'
27+
1528
archives:
16-
- name_template: "{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}"
17-
format_overrides:
18-
- goos: windows
19-
format: zip
29+
- formats:
30+
- zip
31+
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ if eq .Os "darwin" }}macOS{{ else }}{{ .Os }}{{ end }}_{{ .Arch }}'
32+
2033
checksum:
21-
name_template: "{{ .ProjectName }}_v{{ .Version }}_checksums.txt"
34+
algorithm: sha256
35+
name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt'
36+
2237
snapshot:
2338
name_template: "{{ incpatch .Version }}-next"
39+
2440
changelog:
2541
sort: asc
2642
filters:
2743
exclude:
2844
- '^docs:'
29-
- '^test:'
45+
- '^test:'

cmd/scan_direct.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func init() {
3838

3939
directCmd.Flags().StringVarP(&scanDirectFlagFilename, "filename", "f", "", "domain list filename")
4040
directCmd.Flags().StringVarP(&scanDirectFlagOutput, "output", "o", "", "output result")
41-
directCmd.Flags().StringVarP(&scanDirectFlagMethod, "method", "m", "HEAD", "HTTP method to use (e.g. HEAD, GET, POST)")
41+
directCmd.Flags().StringVarP(&scanDirectFlagMethod, "method", "m", "HEAD", "HTTP method to use")
4242
directCmd.Flags().BoolVar(&scanDirectFlagHttps, "https", false, "use https")
4343
directCmd.Flags().StringVar(&scanDirectFlagHideLocation, "hide-location", "https://jio.com/BalanceExhaust", "hide results with this Location header")
4444
directCmd.Flags().IntVar(&scanDirectFlagTimeoutConnect, "timeout-connect", 5, "TCP connect timeout in seconds")

cmd/scan_ping.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package cmd
33
import (
44
"fmt"
55
"net"
6+
"os"
67
"time"
78

89
"github.com/spf13/cobra"
@@ -57,8 +58,8 @@ func pingHost(ctx *queuescanner.Ctx, params *queuescanner.QueueScannerScanParams
5758
func pingRun(cmd *cobra.Command, args []string) {
5859
hosts, err := ReadLinesFromFile(pingFlagFilename)
5960
if err != nil {
60-
fmt.Printf("Error reading file: %v\n", err)
61-
return
61+
fmt.Println(err.Error())
62+
os.Exit(1)
6263
}
6364

6465
fmt.Printf("%-16s %-20s\n", "IP Address", "Host")

cmd/scan_proxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var (
4141
func init() {
4242
rootCmd.AddCommand(scanProxyCmd)
4343

44-
scanProxyCmd.Flags().StringVarP(&scanProxyFlagProxyCidr, "cidr", "c", "", "cidr proxy to scan e.g. 127.0.0.1/32")
44+
scanProxyCmd.Flags().StringVarP(&scanProxyFlagProxyCidr, "cidr", "c", "", "cidr proxy to scan e.g. 104.16.0.0/24")
4545
scanProxyCmd.Flags().StringVar(&scanProxyFlagProxyHost, "proxy", "", "proxy without port")
4646
scanProxyCmd.Flags().StringVarP(&scanProxyFlagProxyHostFilename, "filename", "f", "", "proxy filename without port")
4747
scanProxyCmd.Flags().IntVarP(&scanProxyFlagProxyPort, "port", "p", 80, "proxy port")

cmd/scan_sni.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ func init() {
3636
sniCmd.Flags().IntVar(&sniFlagTimeout, "timeout", 3, "handshake timeout")
3737
sniCmd.Flags().StringVarP(&sniFlagOutput, "output", "o", "", "output result")
3838

39-
sniCmd.MarkFlagFilename("filename")
4039
sniCmd.MarkFlagRequired("filename")
4140
}
4241

0 commit comments

Comments
 (0)