Open linux019 opened 3 years ago
I don't understand your request.
The "extgrpc" sub-package is merely an example:
errors
base package. Why do you think it is a dependency?go build -o main1 main.go I used this tool https://github.com/jondot/goweight to analyze binary
package main
import (
"log"
"strconv"
"github.com/cockroachdb/errors"
)
func main() {
log.Println(f())
}
func f() error {
_, err := strconv.Atoi("1122")
return errors.Wrap(err, "ttt")
}
~/go/bin/goweight .|head -n 10
7.3 MB runtime
6.3 MB net/http
4.3 MB github.com/gogo/protobuf/proto
3.4 MB github.com/gogo/protobuf/types
2.9 MB net
2.7 MB crypto/tls
2.4 MB reflect
1.7 MB github.com/gogo/protobuf/protoc-gen-gogo/descriptor
1.6 MB math/big
1.5 MB syscall
package main
import ( "log" "strconv"
"github.com/pkg/errors"
)
func main() { log.Println(f()) }
func f() error { _, err := strconv.Atoi("1122") return errors.Wrap(err, "ttt") }
~/go/bin/goweight .|head -n 10 7.3 MB runtime 2.4 MB reflect 1.5 MB syscall 873 kB time 777 kB os 710 kB internal/reflectlite 694 kB fmt 476 kB strconv 460 kB internal/poll 446 kB strings
Ok so the problem is not with the extgrpc
package specifically.
We'll look into it
Yeah, I think this is maybe why I cannot use cockroachdb/errors in the Go playground.
Is there any new progress in this problem? I saw that this library has not been updated for a long time, so I want to ask, is this library still maintained?
Yes this is still actively maintained.
Is there any new progress in this problem?After using this library, my program volume has increased a lot
@1379 This errors package is amazing, but since it has so many features, it makes it very heavy weight. That's just the tradeoff.
However, if you just want to use errors with StackTraces (and don't need protobuf, network portability, PII redaction, etc.) you can just use something like https://github.com/StevenACoffman/simplerr that also reconciles the pkg/errors
with std lib errors
, but with out the other goodies.
Thanks!
GoGo protobufs is a dead project. The dependency on gogo can be removed without any subsequent issues
When inspecting go binary I found that it requires gogo protobufs https://github.com/cockroachdb/errors/blob/72ec75208141a2b67e79909b28aea29ed2189108/extgrpc/ext_grpc.go#L182 in init() I do not use gogo in production as it is an outdated project https://github.com/gogo/protobuf/issues/691 Please remove init and gogo dependency