Skip to content

Commit cdbb624

Browse files
authored
update modules and lint (#40)
also update go version to 1.22
1 parent eb5cc9d commit cdbb624

34 files changed

+123
-112
lines changed

.github/workflows/build.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Set up Go
1313
uses: actions/setup-go@v4
1414
with:
15-
go-version: '1.20'
15+
go-version: '1.22'
1616

1717
- name: make verification
1818
run: make verifiers

.github/workflows/release.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Go
1818
uses: actions/setup-go@v4
1919
with:
20-
go-version: 1.21
20+
go-version: 1.22
2121

2222
- name: Login to Docker Hub
2323
uses: docker/login-action@v3
@@ -26,9 +26,10 @@ jobs:
2626
password: ${{ secrets.DOCKERHUB_TOKEN }}
2727

2828
- name: Run GoReleaser
29-
uses: goreleaser/goreleaser-action@v2
29+
uses: goreleaser/goreleaser-action@v6
3030
with:
31-
version: latest
31+
distribution: goreleaser # or 'goreleaser-pro'
32+
version: "~> v2" # or 'latest', 'nightly', semver
3233
args: release --parallelism 1 --clean
3334
env:
3435
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.golangci.yml

-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ linters-settings:
2020
locale: US
2121

2222
gofumpt:
23-
lang-version: "1.21"
24-
2523
# Choose whether or not to use the extra rules that are disabled
2624
# by default
2725
extra-rules: false

.goreleaser.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
version: 2
12
env:
23
- GO111MODULE=on
34
- CGO_ENABLED=0
@@ -21,7 +22,6 @@ builds:
2122

2223
archives:
2324
- format: tar.gz
24-
rlcp: true
2525
files:
2626
- README.md
2727
- LICENSE

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pb query "select * from backend" --from=1m --to=now
5151
or specifying time range in rfc3999
5252

5353
```bash
54-
pb query "select * from backend" --from=2023-01-00T01:40:00.000Z --to=2023-01-00T01:55:00.000Z
54+
pb query "select * from backend" --from=2024-01-00T01:40:00.000Z --to=2024-01-00T01:55:00.000Z
5555
```
5656

5757
You can use tools like `jq` and `grep` to further process and filter the output. Some examples:

buildscripts/checkdeps.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
#
3-
# Copyright (c) 2023 Cloudnatively Services Pvt Ltd
3+
# Copyright (c) 2024 Parseable, Inc
44
#
55
# This program is free software: you can redistribute it and/or modify
66
# it under the terms of the GNU Affero General Public License as published by

buildscripts/cross-compile.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
#
3-
# Copyright (c) 2023 Cloudnatively Services Pvt Ltd
3+
# Copyright (c) 2024 Parseable, Inc
44
#
55
# This program is free software: you can redistribute it and/or modify
66
# it under the terms of the GNU Affero General Public License as published by

buildscripts/gen-ldflags.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//go:build ignore
22
// +build ignore
33

4-
// Copyright (c) 2023 Cloudnatively Services Pvt Ltd
4+
// Copyright (c) 2024 Parseable, Inc
55
//
66
// This program is free software: you can redistribute it and/or modify
77
// it under the terms of the GNU Affero General Public License as published by

cmd/about.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2023 Cloudnatively Services Pvt Ltd
1+
// Copyright (c) 2024 Parseable, Inc
22
//
33
// This program is free software: you can redistribute it and/or modify
44
// it under the terms of the GNU Affero General Public License as published by

cmd/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2023 Cloudnatively Services Pvt Ltd
1+
// Copyright (c) 2024 Parseable, Inc
22
//
33
//
44
// This program is free software: you can redistribute it and/or modify

cmd/pre.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2023 Cloudnatively Services Pvt Ltd
1+
// Copyright (c) 2024 Parseable, Inc
22
//
33
//
44
// This program is free software: you can redistribute it and/or modify

cmd/profile.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2023 Cloudnatively Services Pvt Ltd
1+
// Copyright (c) 2024 Parseable, Inc
22
//
33
// This program is free software: you can redistribute it and/or modify
44
// it under the terms of the GNU Affero General Public License as published by
@@ -65,7 +65,7 @@ var AddProfileCmd = &cobra.Command{
6565
}
6666
return cobra.MaximumNArgs(4)(cmd, args)
6767
},
68-
RunE: func(cmd *cobra.Command, args []string) error {
68+
RunE: func(_ *cobra.Command, args []string) error {
6969
name := args[0]
7070
url, err := url.Parse(args[1])
7171
if err != nil {
@@ -126,7 +126,7 @@ var RemoveProfileCmd = &cobra.Command{
126126
Example: " pb profile remove local_parseable",
127127
Args: cobra.ExactArgs(1),
128128
Short: "Delete a profile",
129-
RunE: func(cmd *cobra.Command, args []string) error {
129+
RunE: func(_ *cobra.Command, args []string) error {
130130
name := args[0]
131131
fileConfig, err := config.ReadConfigFromFile()
132132
if err != nil {
@@ -154,7 +154,7 @@ var DefaultProfileCmd = &cobra.Command{
154154
Args: cobra.MaximumNArgs(1),
155155
Short: "Set default profile to use with all commands",
156156
Example: " pb profile default local_parseable",
157-
RunE: func(cmd *cobra.Command, args []string) error {
157+
RunE: func(_ *cobra.Command, args []string) error {
158158
var name string
159159

160160
fileConfig, err := config.ReadConfigFromFile()
@@ -199,7 +199,7 @@ var ListProfileCmd = &cobra.Command{
199199
Use: "list profiles",
200200
Short: "List all added profiles",
201201
Example: " pb profile list",
202-
RunE: func(cmd *cobra.Command, args []string) error {
202+
RunE: func(_ *cobra.Command, _ []string) error {
203203
fileConfig, err := config.ReadConfigFromFile()
204204
if err != nil {
205205
return nil

cmd/query.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2023 Cloudnatively Services Pvt Ltd
1+
// Copyright (c) 2024 Parseable, Inc
22
//
33
// This program is free software: you can redistribute it and/or modify
44
// it under the terms of the GNU Affero General Public License as published by
@@ -106,8 +106,8 @@ var query = &cobra.Command{
106106

107107
var QueryCmd = func() *cobra.Command {
108108
query.Flags().BoolP(interactiveFlag, interactiveFlagShort, false, "open the query result in interactive mode")
109-
query.Flags().StringP(startFlag, startFlagShort, defaultStart, "Start time for query. Takes date as '2023-10-12T07:20:50.52Z' or string like '10m', '1hr'")
110-
query.Flags().StringP(endFlag, endFlagShort, defaultEnd, "End time for query. Takes date as '2023-10-12T07:20:50.52Z' or 'now'")
109+
query.Flags().StringP(startFlag, startFlagShort, defaultStart, "Start time for query. Takes date as '2024-10-12T07:20:50.52Z' or string like '10m', '1hr'")
110+
query.Flags().StringP(endFlag, endFlagShort, defaultEnd, "End time for query. Takes date as '2024-10-12T07:20:50.52Z' or 'now'")
111111
return query
112112
}()
113113

cmd/role.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2023 Cloudnatively Services Pvt Ltd
1+
// Copyright (c) 2024 Parseable, Inc
22
//
33
// This program is free software: you can redistribute it and/or modify
44
// it under the terms of the GNU Affero General Public License as published by
@@ -66,7 +66,7 @@ var AddRoleCmd = &cobra.Command{
6666
Example: " pb role add ingestors",
6767
Short: "Add a new role",
6868
Args: cobra.ExactArgs(1),
69-
RunE: func(cmd *cobra.Command, args []string) error {
69+
RunE: func(_ *cobra.Command, args []string) error {
7070
name := args[0]
7171

7272
// check if the role already exists
@@ -157,7 +157,7 @@ var RemoveRoleCmd = &cobra.Command{
157157
Example: " pb role remove ingestor",
158158
Short: "Delete a role",
159159
Args: cobra.ExactArgs(1),
160-
RunE: func(cmd *cobra.Command, args []string) error {
160+
RunE: func(_ *cobra.Command, args []string) error {
161161
name := args[0]
162162
client := DefaultClient()
163163
req, err := client.NewRequest("DELETE", "role/"+name, nil)
@@ -191,7 +191,7 @@ var ListRoleCmd = &cobra.Command{
191191
Use: "list",
192192
Short: "List all roles",
193193
Example: " pb role list",
194-
RunE: func(cmd *cobra.Command, args []string) error {
194+
RunE: func(_ *cobra.Command, _ []string) error {
195195
var roles []string
196196
client := DefaultClient()
197197
err := fetchRoles(&client, &roles)

cmd/stream.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2023 Cloudnatively Services Pvt Ltd
1+
// Copyright (c) 2024 Parseable, Inc
22
//
33
// This program is free software: you can redistribute it and/or modify
44
// it under the terms of the GNU Affero General Public License as published by
@@ -97,7 +97,7 @@ var AddStreamCmd = &cobra.Command{
9797
Example: " pb stream add backend_logs",
9898
Short: "Create a new stream",
9999
Args: cobra.ExactArgs(1),
100-
RunE: func(cmd *cobra.Command, args []string) error {
100+
RunE: func(_ *cobra.Command, args []string) error {
101101
name := args[0]
102102
client := DefaultClient()
103103
req, err := client.NewRequest("PUT", "logstream/"+name, nil)
@@ -132,7 +132,7 @@ var StatStreamCmd = &cobra.Command{
132132
Example: " pb stream info backend_logs",
133133
Short: "Get statistics for a stream",
134134
Args: cobra.ExactArgs(1),
135-
RunE: func(cmd *cobra.Command, args []string) error {
135+
RunE: func(_ *cobra.Command, args []string) error {
136136
name := args[0]
137137
client := DefaultClient()
138138

@@ -212,7 +212,7 @@ var RemoveStreamCmd = &cobra.Command{
212212
Example: " pb stream remove backend_logs",
213213
Short: "Delete a stream",
214214
Args: cobra.ExactArgs(1),
215-
RunE: func(cmd *cobra.Command, args []string) error {
215+
RunE: func(_ *cobra.Command, args []string) error {
216216
name := args[0]
217217
client := DefaultClient()
218218
req, err := client.NewRequest("DELETE", "logstream/"+name, nil)
@@ -246,7 +246,7 @@ var ListStreamCmd = &cobra.Command{
246246
Use: "list",
247247
Short: "List all streams",
248248
Example: " pb stream list",
249-
RunE: func(cmd *cobra.Command, args []string) error {
249+
RunE: func(_ *cobra.Command, _ []string) error {
250250
client := DefaultClient()
251251
req, err := client.NewRequest("GET", "logstream", nil)
252252
if err != nil {

cmd/style.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2023 Cloudnatively Services Pvt Ltd
1+
// Copyright (c) 2024 Parseable, Inc
22
//
33
//
44
// This program is free software: you can redistribute it and/or modify

cmd/tail.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2023 Cloudnatively Services Pvt Ltd
1+
// Copyright (c) 2024 Parseable, Inc
22
//
33
//
44
// This program is free software: you can redistribute it and/or modify
@@ -38,7 +38,7 @@ var TailCmd = &cobra.Command{
3838
Short: "Stream live events from a log stream",
3939
Args: cobra.ExactArgs(1),
4040
PreRunE: PreRunDefaultProfile,
41-
RunE: func(cmd *cobra.Command, args []string) error {
41+
RunE: func(_ *cobra.Command, args []string) error {
4242
name := args[0]
4343
profile := DefaultProfile
4444
return tail(profile, name)

cmd/user.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2023 Cloudnatively Services Pvt Ltd
1+
// Copyright (c) 2024 Parseable, Inc
22
//
33
// This program is free software: you can redistribute it and/or modify
44
// it under the terms of the GNU Affero General Public License as published by
@@ -122,7 +122,7 @@ var RemoveUserCmd = &cobra.Command{
122122
Example: " pb user remove bob",
123123
Short: "Delete a user",
124124
Args: cobra.ExactArgs(1),
125-
RunE: func(cmd *cobra.Command, args []string) error {
125+
RunE: func(_ *cobra.Command, args []string) error {
126126
name := args[0]
127127
client := DefaultClient()
128128
req, err := client.NewRequest("DELETE", "user/"+name, nil)
@@ -156,13 +156,13 @@ var SetUserRoleCmd = &cobra.Command{
156156
Use: "set-role user-name roles",
157157
Short: "Set roles for a user",
158158
Example: " pb user set-role bob admin,developer",
159-
PreRunE: func(cmd *cobra.Command, args []string) error {
159+
PreRunE: func(_ *cobra.Command, args []string) error {
160160
if len(args) < 2 {
161161
return fmt.Errorf("requires at least 2 arguments")
162162
}
163163
return nil
164164
},
165-
RunE: func(cmd *cobra.Command, args []string) error {
165+
RunE: func(_ *cobra.Command, args []string) error {
166166
name := args[0]
167167

168168
client := DefaultClient()
@@ -232,7 +232,7 @@ var ListUserCmd = &cobra.Command{
232232
Use: "list",
233233
Short: "List all users",
234234
Example: " pb user list",
235-
RunE: func(cmd *cobra.Command, args []string) error {
235+
RunE: func(_ *cobra.Command, _ []string) error {
236236
client := DefaultClient()
237237
users, err := fetchUsers(&client)
238238
if err != nil {

cmd/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2023 Cloudnatively Services Pvt Ltd
1+
// Copyright (c) 2024 Parseable, Inc
22
//
33
// This program is free software: you can redistribute it and/or modify
44
// it under the terms of the GNU Affero General Public License as published by

go.mod

+20-16
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,38 @@
11
module pb
22

3-
go 1.20
3+
go 1.22
44

55
require (
66
github.com/apache/arrow/go/v13 v13.0.0
77
github.com/charmbracelet/bubbles v0.16.1
8-
github.com/charmbracelet/bubbletea v0.24.2
8+
github.com/charmbracelet/bubbletea v0.26.4
99
github.com/dustin/go-humanize v1.0.1
10-
golang.org/x/exp v0.0.0-20230807204917-050eac23e9de
11-
golang.org/x/term v0.13.0
12-
google.golang.org/grpc v1.56.3
10+
golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8
11+
golang.org/x/term v0.21.0
12+
google.golang.org/grpc v1.64.0
1313
)
1414

1515
require (
16+
github.com/charmbracelet/x/ansi v0.1.2 // indirect
17+
github.com/charmbracelet/x/input v0.1.0 // indirect
18+
github.com/charmbracelet/x/term v0.1.1 // indirect
19+
github.com/charmbracelet/x/windows v0.1.0 // indirect
20+
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
1621
github.com/goccy/go-json v0.10.0 // indirect
17-
github.com/golang/protobuf v1.5.3 // indirect
1822
github.com/google/flatbuffers v23.1.21+incompatible // indirect
1923
github.com/inconshreveable/mousetrap v1.1.0 // indirect
2024
github.com/klauspost/compress v1.15.15 // indirect
2125
github.com/klauspost/cpuid/v2 v2.2.3 // indirect
2226
github.com/pierrec/lz4/v4 v4.1.17 // indirect
2327
github.com/spf13/pflag v1.0.5 // indirect
28+
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
2429
github.com/zeebo/xxh3 v1.0.2 // indirect
25-
golang.org/x/mod v0.11.0 // indirect
26-
golang.org/x/net v0.17.0 // indirect
27-
golang.org/x/tools v0.6.0 // indirect
30+
golang.org/x/mod v0.18.0 // indirect
31+
golang.org/x/net v0.26.0 // indirect
32+
golang.org/x/tools v0.22.0 // indirect
2833
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
29-
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
30-
google.golang.org/protobuf v1.30.0 // indirect
34+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
35+
google.golang.org/protobuf v1.34.1 // indirect
3136
)
3237

3338
require (
@@ -41,17 +46,16 @@ require (
4146

4247
require (
4348
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
44-
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
4549
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
4650
github.com/mattn/go-isatty v0.0.19 // indirect
4751
github.com/mattn/go-localereader v0.0.1 // indirect
4852
github.com/mattn/go-runewidth v0.0.15 // indirect
4953
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
5054
github.com/muesli/cancelreader v0.2.2 // indirect
5155
github.com/muesli/reflow v0.3.0 // indirect
52-
github.com/rivo/uniseg v0.4.4 // indirect
56+
github.com/rivo/uniseg v0.4.7 // indirect
5357
github.com/spf13/cobra v1.7.0
54-
golang.org/x/sync v0.3.0 // indirect
55-
golang.org/x/sys v0.13.0 // indirect
56-
golang.org/x/text v0.13.0 // indirect
58+
golang.org/x/sync v0.7.0 // indirect
59+
golang.org/x/sys v0.21.0 // indirect
60+
golang.org/x/text v0.16.0 // indirect
5761
)

0 commit comments

Comments
 (0)