Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): upgrade to pb v3 #128

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions client/conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ func Load() error {
if _, err = os.Stat(cdir); os.IsNotExist(err) {
log.Printf("Creating %v directory.\n", cdir)
if err := os.Mkdir(cdir, 0700); err != nil {
return fmt.Errorf("unable to create %v directory: %w", cdir, err)
return fmt.Errorf("creating %v directory: %w", cdir, err)
}
} else if err != nil {
return err
return fmt.Errorf("parsing %v directory: %w", cdir, err)
}
if _, err = os.Stat(cf); os.IsNotExist(err) {
log.Printf("Configuration file %v not found. Writing default configuration.\n", cf)
C.Service = "http://127.0.0.1:8080"
if conf, err = yaml.Marshal(C); err != nil {
return err
return fmt.Errorf("marshalling yaml: %w", err)
}
return os.WriteFile(cf, conf, 0644)
} else if err != nil {
Expand Down
14 changes: 4 additions & 10 deletions client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"time"

"github.com/atotto/clipboard"
"github.com/cheggaaa/pb/v3"
flag "github.com/ogier/pflag"
"gopkg.in/cheggaaa/pb.v1"

"github.com/Depado/goploader/client/conf"
"github.com/Depado/goploader/client/screenshot"
Expand Down Expand Up @@ -42,18 +42,12 @@ func initBar(f *os.File) {
fmt.Println("Could not stat", f.Name())
os.Exit(1)
}
bar = pb.New64(fi.Size()).SetUnits(pb.U_BYTES).SetRefreshRate(time.Millisecond * 10)
bar.ShowPercent = true
bar.ShowSpeed = true
bar.ShowTimeLeft = true
bar = pb.Full.Start64(fi.Size()).Set(pb.Bytes, true)
bar.Start()
}

func initUnknownBar() {
bar = pb.New64(0).SetUnits(pb.U_BYTES).SetRefreshRate(time.Millisecond * 10)
bar.ShowSpeed = true
bar.ShowCounters = true
bar.ShowBar = false
bar = pb.Full.Start64(0).Set(pb.Bytes, true)
bar.Start()
}

Expand Down Expand Up @@ -164,7 +158,7 @@ func main() {
log.Fatal(err)
}
if progress {
part = io.MultiWriter(part, bar)
part = bar.NewProxyWriter(part)
}
if _, err = io.Copy(part, datasource); err != nil {
log.Fatal(err)
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@ require (
dario.cat/mergo v1.0.1
github.com/asdine/storm v2.1.2+incompatible
github.com/atotto/clipboard v0.1.4
github.com/cheggaaa/pb/v3 v3.1.6
github.com/dchest/uniuri v1.2.0
github.com/fatih/color v1.18.0
github.com/gin-gonic/gin v1.10.0
github.com/mitchellh/go-homedir v1.1.0
github.com/ogier/pflag v0.0.1
github.com/prometheus/client_golang v1.21.0
go.etcd.io/bbolt v1.4.0
gopkg.in/cheggaaa/pb.v1 v1.0.28
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/DataDog/zstd v1.5.2 // indirect
github.com/Sereal/Sereal v0.0.0-20220220040404-e0d1e550e879 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bytedance/sonic v1.12.9 // indirect
github.com/bytedance/sonic/loader v0.2.3 // indirect
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8=
github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw=
github.com/Sereal/Sereal v0.0.0-20220220040404-e0d1e550e879 h1:M5ptEKnqKqpFTKbe+p5zEf3ro1deJ6opUz5j3g3/ErQ=
github.com/Sereal/Sereal v0.0.0-20220220040404-e0d1e550e879/go.mod h1:D0JMgToj/WdxCgd30Kc1UcA9E+WdZoJqeVOuYW7iTBM=
github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow=
github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4=
github.com/asdine/storm v2.1.2+incompatible h1:dczuIkyqwY2LrtXPz8ixMrU/OFgZp71kbKTHGrXYt/Q=
github.com/asdine/storm v2.1.2+incompatible/go.mod h1:RarYDc9hq1UPLImuiXK3BIWPJLdIygvV3PsInK0FbVQ=
github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4=
Expand All @@ -17,6 +19,8 @@ github.com/bytedance/sonic/loader v0.2.3 h1:yctD0Q3v2NOGfSWPLPvG2ggA2kV6TS6s4wio
github.com/bytedance/sonic/loader v0.2.3/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cheggaaa/pb/v3 v3.1.6 h1:h0x+vd7EiUohAJ29DJtJy+SNAc55t/elW3jCD086EXk=
github.com/cheggaaa/pb/v3 v3.1.6/go.mod h1:urxmfVtaxT+9aWk92DbsvXFZtNSWQSO5TRAp+MJ3l1s=
github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4=
github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w=
github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY=
Expand Down Expand Up @@ -148,8 +152,6 @@ google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojt
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/cheggaaa/pb.v1 v1.0.28 h1:n1tBJnnK2r7g9OW2btFH91V92STTUevLXYFb8gy9EMk=
gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
Loading