profile
viewpoint

521xueweihan/HelloGitHub 35003

:octocat: Find pearls on open-source seashore 分享 GitHub 上有趣、入门级的开源项目

daixiang0/gci 40

GCI, a tool that control golang package import order and make it always deterministic.

daixiang0/docker_practice 1

Learn and understand Docker technologies, with real DevOps practice!

daixiang0/beehive 0

Pluggable module(in-process microservice) and cross-module communication Framework

daixiang0/bitnami-docker-postgresql-repmgr 0

Bitnami PostgreSQL with Replication Manager Docker Image

daixiang0/bpftool 0

Scripts for building bpftool

daixiang0/buildx 0

Docker CLI plugin for extended build capabilities with BuildKit

daixiang0/ceph 0

Ceph is a distributed object, block, and file storage platform

daixiang0/charts 0

Curated applications for Kubernetes

daixiang0/cli 0

GitHub’s official command line tool

PR opened daixiang0/gci

Extract imports processing into function

I want to use the imports processing for a code generator that I'm working on, so I extracted this functionality into a public function which I can import. It's also probably a bit cleaner this way since the code in Run and in ProcessFile was mostly the same.

+31 -29

0 comment

1 changed file

pr created time in a day

fork mathieupost/gci

GCI, a tool that control golang package import order and make it always deterministic.

fork in a day

starteddaixiang0/gci

started time in 4 days

starteddaixiang0/gci

started time in 4 days

starteddaixiang0/gci

started time in 6 days

pull request commentdaixiang0/gci

hardcode standard package names

@daixiang0 my PR does not address the exit code issue - nevertheless I think hardcoding the package names is a good idea for performance reasons.

The exit code issue - returning exit code 0 when in write mode and no error occurs - belongs in a separate PR.

kwo

comment created time in 8 days

pull request commentdaixiang0/gci

hardcode standard package names

:+1:

in the case of -d yes, in the case of -w I don't think so, most of the linter/formatting tools are just exiting with 0 even if there are changes, but they return 1 in case of real errors (i.e., syntax error)

moul@fwrz:~/go/src/berty.tech/berty (dependabot/go_modules/github.com/daixiang0/gci-0.2.5) $ gci -w .; echo $?
skip file go/cmd/berty/doc.go since no import
skip file go/cmd/berty/mini/doc.go since no import
skip file go/cmd/berty/mini/example_test.go since no import
[...]
skip file go/pkg/username/others.go since no import
skip file go/pkg/username/username.go since no import
skip file tool/test/experiment/dht/dht.go since no import
1

btw, the version 0.2.4 returned 0 for -w, the behavior changed with 0.2.5

kwo

comment created time in 8 days

pull request commentdaixiang0/gci

hardcode standard package names

The exit code is out of scope for my PRs but logically, shouldn't the exit code be non-zero if there are diffs?

kwo

comment created time in 8 days

pull request commentdaixiang0/gci

hardcode standard package names

btw, did you check the exit code? because when I run your command I also get some diff, but if I add echo $? after I clearly see that it diffs, but also exits with 1

moul@fwrz:~/go/src/berty.tech/berty (dependabot/go_modules/github.com/daixiang0/gci-0.2.5) $ gci -d .
[...]
diff -u tool/test/experiment/dht/test/basic_test.go.orig tool/test/experiment/dht/test/basic_test.go
--- tool/test/experiment/dht/test/basic_test.go.orig    2020-11-20 15:54:35.467088817 +0100
+++ tool/test/experiment/dht/test/basic_test.go 2020-11-20 15:54:35.467088817 +0100
@@ -1,16 +1,14 @@
 package test
 
 import (
-       "testing"
-
-       . "github.com/smartystreets/goconvey/convey"
-
        "berty.tech/berty/experiment/dht"
        "berty.tech/berty/experiment/dht/src/bittorrent"
        "berty.tech/berty/experiment/dht/src/chord"
        "berty.tech/berty/experiment/dht/src/gnunet"
        "berty.tech/berty/experiment/dht/src/libp2p"
        "berty.tech/berty/experiment/dht/src/matrix"
+       . "github.com/smartystreets/goconvey/convey"
+       "testing"
 )
 
 func TestBasic(t *testing.T) {
moul@fwrz:~/go/src/berty.tech/berty (dependabot/go_modules/github.com/daixiang0/gci-0.2.5) $ echo $?
1

same result if running from root or from go/ btw

kwo

comment created time in 8 days

pull request commentdaixiang0/gci

hardcode standard package names

I think the issue is that you need to execute the command from the project root directory (where go.mod) is located - not from <PROJECT_ROOT>/go. When I run the command from the <PROJECT_ROOT>/go directory, I get the same result as you (exit status 1). But from the <PROJECT_ROOT>, the desired result.

kwo

comment created time in 8 days

pull request commentdaixiang0/gci

hardcode standard package names

moul@fwrz:~/go/src/github.com/daixiang0/gci (cache-stdlib-package-names) $ rm -f ~/go/bin/gci
moul@fwrz:~/go/src/github.com/daixiang0/gci (cache-stdlib-package-names) $ gci
-bash: /home/moul/go/bin/gci: No such file or directory
moul@fwrz:~/go/src/github.com/daixiang0/gci (cache-stdlib-package-names) $ git log -1
commit 316c2a0df03b96976c688ee08e187b8ebaea4c1c (HEAD -> cache-stdlib-package-names)
Author: Karl Ostendorf <karl@ostendorf.com>
Date:   Fri Nov 20 13:52:48 2020 +0100

    hardcode standard package names
moul@fwrz:~/go/src/github.com/daixiang0/gci (cache-stdlib-package-names) $ go install
moul@fwrz:~/go/src/github.com/daixiang0/gci (cache-stdlib-package-names) $ gci
moul@fwrz:~/go/src/github.com/daixiang0/gci (cache-stdlib-package-names) $ cd ~/go/src/berty.tech/berty/go
moul@fwrz:~/go/src/berty.tech/berty/go (dependabot/go_modules/github.com/daixiang0/gci-0.2.5) $ gci -w -local berty.tech .
skip file cmd/berty/doc.go since no import
skip file cmd/berty/mini/doc.go since no import
skip file cmd/berty/mini/example_test.go since no import
[...]
skip file pkg/username/ios.go since no import
skip file pkg/username/others.go since no import
skip file pkg/username/username.go since no import
moul@fwrz:~/go/src/berty.tech/berty/go (dependabot/go_modules/github.com/daixiang0/gci-0.2.5) $ echo $?
1
kwo

comment created time in 8 days

pull request commentdaixiang0/gci

hardcode standard package names

Can you run gci by itself - not from the Makefile?

kwo

comment created time in 8 days

pull request commentdaixiang0/gci

hardcode standard package names

I have no issues with my version of gci on that branch:

15:20:03 karl@kaos:~/projects/temp/berty$ git status
On branch dependabot/go_modules/github.com/daixiang0/gci-0.2.5
Your branch is up to date with 'origin/dependabot/go_modules/github.com/daixiang0/gci-0.2.5'.

nothing to commit, working tree clean
15:20:04 karl@kaos:~/projects/temp/berty$ gci -d -local berty.tech .
skip file go/cmd/berty/doc.go since no import
skip file go/cmd/berty/mini/doc.go since no import
skip file go/cmd/berty/mini/example_test.go since no import
skip file go/cmd/berty-doctor/example_test.go since no import
skip file go/cmd/betabot/example_test.go since no import
skip file go/cmd/rdvp/doc.go since no import
skip file go/cmd/rdvp/example_test.go since no import
skip file go/cmd/testbot/example_test.go since no import
skip file go/framework/bertybridge/config.go since no import
skip file go/framework/bertybridge/config_android.go since no import
skip file go/framework/bertybridge/doc.go since no import
skip file go/internal/ble-driver/const.go since no import
skip file go/internal/ble-driver/example_test.go since no import
skip file go/internal/cryptoutil/doc.go since no import
skip file go/internal/discordlog/doc.go since no import
skip file go/internal/grpcutil/doc.go since no import
skip file go/internal/handshake/doc.go since no import
skip file go/internal/initutil/tor_embedded.go since no import
skip file go/internal/initutil/tor_unembedded.go since no import
skip file go/internal/ipfsutil/doc.go since no import
skip file go/internal/ipfsutil/metrics.go since no import
skip file go/internal/lifecycle/example_test.go since no import
skip file go/internal/multipeer-connectivity-driver/const.go since no import
skip file go/internal/multipeer-connectivity-driver/example_test.go since no import
skip file go/internal/notification/example_test.go since no import
skip file go/internal/notification/manager.go since no import
skip file go/internal/notification/manager_noop.go since no import
skip file go/internal/packingutil/example_test.go since no import
skip file go/internal/proximity-transport/addr.go since no import
skip file go/internal/proximity-transport/example_test.go since no import
skip file go/internal/proximity-transport/nativedriver.go since no import
skip file go/internal/sysutil/sysutil_unsupported.go since no import
skip file go/internal/testutil/doc.go since no import
skip file go/internal/testutil/example_test.go since no import
skip file go/internal/tinder/doc.go since no import
skip file go/internal/tools/example_test.go since no import
skip file go/internal/tools/tools_untool.go since no import
skip file go/pkg/assets/embed.go since no import
skip file go/pkg/assets/example_test.go since no import
skip file go/pkg/banner/doc.go since no import
skip file go/pkg/bertybot/commands.go since no import
skip file go/pkg/bertymessenger/doc.go since no import
skip file go/pkg/bertyprotocol/doc.go since no import
skip file go/pkg/bertyprotocol/services_auth_templates.go since no import
skip file go/pkg/bertytypes/config.go since no import
skip file go/pkg/bertytypes/doc.go since no import
skip file go/pkg/bertytypes/events_account.go since no import
skip file go/pkg/bertytypes/example_test.go since no import
skip file go/pkg/bertyversion/example_test.go since no import
skip file go/pkg/bertyversion/version.go since no import
skip file go/pkg/errcode/doc.go since no import
skip file go/pkg/errcode/stdproto.go since no import
skip file go/pkg/tempdir/tempdir.go since no import
skip file go/pkg/tempdir/tempdir_darwin.go since no import
skip file go/pkg/tempdir/tempdir_others.go since no import
skip file go/pkg/username/android.go since no import
skip file go/pkg/username/example_test.go since no import
skip file go/pkg/username/ios.go since no import
skip file go/pkg/username/others.go since no import
skip file go/pkg/username/username.go since no import
skip file tool/test/experiment/dht/dht.go since no import
diff -u tool/test/experiment/dht/src/matrix/dht.go.orig tool/test/experiment/dht/src/matrix/dht.go
--- tool/test/experiment/dht/src/matrix/dht.go.orig	2020-11-20 15:20:11.000000000 +0100
+++ tool/test/experiment/dht/src/matrix/dht.go	2020-11-20 15:20:11.000000000 +0100
@@ -4,10 +4,10 @@
 	"encoding/json"
 	"fmt"

+	"github.com/matrix-org/gomatrix"
 	"github.com/pkg/errors"

 	"berty.tech/berty/experiment/dht"
-	"github.com/matrix-org/gomatrix"
 )

 var _ dht.DHT = (*DHT)(nil)
diff -u tool/test/experiment/dht/test/basic_test.go.orig tool/test/experiment/dht/test/basic_test.go
--- tool/test/experiment/dht/test/basic_test.go.orig	2020-11-20 15:20:11.000000000 +0100
+++ tool/test/experiment/dht/test/basic_test.go	2020-11-20 15:20:11.000000000 +0100
@@ -3,13 +3,14 @@
 import (
 	"testing"

+	. "github.com/smartystreets/goconvey/convey"
+
 	"berty.tech/berty/experiment/dht"
 	"berty.tech/berty/experiment/dht/src/bittorrent"
 	"berty.tech/berty/experiment/dht/src/chord"
 	"berty.tech/berty/experiment/dht/src/gnunet"
 	"berty.tech/berty/experiment/dht/src/libp2p"
 	"berty.tech/berty/experiment/dht/src/matrix"
-	. "github.com/smartystreets/goconvey/convey"
 )

 func TestBasic(t *testing.T) {
kwo

comment created time in 8 days

pull request commentdaixiang0/gci

hardcode standard package names

same on my machine:

moul@fwrz:~/go/src/berty.tech/berty/go (dependabot/go_modules/github.com/daixiang0/gci-0.2.5) $ go list -m -mod=mod -f {{.Dir}} github.com/daixiang0/gci
/home/moul/go/pkg/mod/github.com/kwo/gci@v0.2.6-0.20201120125248-316c2a0df03b
moul@fwrz:~/go/src/berty.tech/berty/go (dependabot/go_modules/github.com/daixiang0/gci-0.2.5) $ make go.fmt
go run github.com/daixiang0/gci -w -local berty.tech .
skip file cmd/berty/doc.go since no import
skip file cmd/berty/mini/doc.go since no import
skip file cmd/berty/mini/example_test.go since no import
[...]
skip file pkg/username/ios.go since no import
skip file pkg/username/others.go since no import
skip file pkg/username/username.go since no import
exit status 1
Makefile:203: recipe for target 'go.fmt' failed
make: *** [go.fmt] Error 1
kwo

comment created time in 8 days

pull request commentdaixiang0/gci

hardcode standard package names

still the same issue I fear -> https://github.com/berty/berty/pull/2771/checks?check_run_id=1431070616#step:8:86

btw, is there any way to get more verbose output, especially when program exits

kwo

comment created time in 8 days

pull request commentdaixiang0/gci

hardcode standard package names

I just updated https://github.com/berty/berty/pull/2771 with your PR as the target for gci, let's see what happens

kwo

comment created time in 8 days

PR opened daixiang0/gci

hardcode standard package names

This PR should fix issue #23 - instead of shelling out to go list std at program start to gather the list of stdlib package names, the list is hardcoded. Apparently, programmatic access to the list of stdlib package names does not work consistently across different machines as expected.

Pros:

  • removes dependency on external program to retrieve list of standard package name
  • removes performance penalty of shelling out to external program at program start

Cons

  • introduces minor maintenance task to add packages to the list when new ones are added to the language
  • hardcoding data not as elegant as an algorithmic approach (yet works much better)
+156 -19

0 comment

2 changed files

pr created time in 8 days

issue commentdaixiang0/gci

upgrading to v0.2.5 results in `exit 1` without any other change

Thanks for the info. There's nothing there that seems strange. I think the problem must lie in gci now shelling out to run the go list std command at start - apparently this does not always work on all machines as expected. I am working on a fix to hardcode the std package names and will be submitting a PR shortly.

moul

comment created time in 8 days

issue commentdaixiang0/gci

upgrading to v0.2.5 results in `exit 1` without any other change

(I'm upgrading our protoc docker image with the latest go version in https://github.com/berty/berty/pull/2773, then I will rebase the dependabot PR)

moul

comment created time in 8 days

issue commentdaixiang0/gci

upgrading to v0.2.5 results in `exit 1` without any other change

This is mine:

$ go list std
archive/tar
archive/zip
bufio
bytes
compress/bzip2
compress/flate
compress/gzip
compress/lzw
compress/zlib
container/heap
container/list
container/ring
context
crypto
crypto/aes
crypto/cipher
crypto/des
crypto/dsa
crypto/ecdsa
crypto/ed25519
crypto/ed25519/internal/edwards25519
crypto/elliptic
crypto/hmac
crypto/internal/randutil
crypto/internal/subtle
crypto/md5
crypto/rand
crypto/rc4
crypto/rsa
crypto/sha1
crypto/sha256
crypto/sha512
crypto/subtle
crypto/tls
crypto/x509
crypto/x509/pkix
database/sql
database/sql/driver
debug/dwarf
debug/elf
debug/gosym
debug/macho
debug/pe
debug/plan9obj
encoding
encoding/ascii85
encoding/asn1
encoding/base32
encoding/base64
encoding/binary
encoding/csv
encoding/gob
encoding/hex
encoding/json
encoding/pem
encoding/xml
errors
expvar
flag
fmt
go/ast
go/build
go/constant
go/doc
go/format
go/importer
go/internal/gccgoimporter
go/internal/gcimporter
go/internal/srcimporter
go/parser
go/printer
go/scanner
go/token
go/types
hash
hash/adler32
hash/crc32
hash/crc64
hash/fnv
html
html/template
image
image/color
image/color/palette
image/draw
image/gif
image/internal/imageutil
image/jpeg
image/png
index/suffixarray
internal/bytealg
internal/cfg
internal/cpu
internal/fmtsort
internal/goroot
internal/goversion
internal/lazyregexp
internal/lazytemplate
internal/nettrace
internal/oserror
internal/poll
internal/race
internal/reflectlite
internal/singleflight
internal/syscall/unix
internal/testenv
internal/testlog
internal/trace
internal/xcoff
io
io/ioutil
log
log/syslog
math
math/big
math/bits
math/cmplx
math/rand
mime
mime/multipart
mime/quotedprintable
net
net/http
net/http/cgi
net/http/cookiejar
net/http/fcgi
net/http/httptest
net/http/httptrace
net/http/httputil
net/http/internal
net/http/pprof
net/internal/socktest
net/mail
net/rpc
net/rpc/jsonrpc
net/smtp
net/textproto
net/url
os
os/exec
os/signal
os/signal/internal/pty
os/user
path
path/filepath
plugin
reflect
regexp
regexp/syntax
runtime
runtime/cgo
runtime/debug
runtime/internal/atomic
runtime/internal/math
runtime/internal/sys
runtime/pprof
runtime/pprof/internal/profile
runtime/race
runtime/trace
sort
strconv
strings
sync
sync/atomic
syscall
testing
testing/internal/testdeps
testing/iotest
testing/quick
text/scanner
text/tabwriter
text/template
text/template/parse
time
unicode
unicode/utf16
unicode/utf8
unsafe
vendor/golang.org/x/crypto/chacha20poly1305
vendor/golang.org/x/crypto/cryptobyte
vendor/golang.org/x/crypto/cryptobyte/asn1
vendor/golang.org/x/crypto/curve25519
vendor/golang.org/x/crypto/hkdf
vendor/golang.org/x/crypto/internal/chacha20
vendor/golang.org/x/crypto/internal/subtle
vendor/golang.org/x/crypto/poly1305
vendor/golang.org/x/net/dns/dnsmessage
vendor/golang.org/x/net/http/httpguts
vendor/golang.org/x/net/http/httpproxy
vendor/golang.org/x/net/http2/hpack
vendor/golang.org/x/net/idna
vendor/golang.org/x/net/nettest
vendor/golang.org/x/sys/cpu
vendor/golang.org/x/text/secure/bidirule
vendor/golang.org/x/text/transform
vendor/golang.org/x/text/unicode/bidi
vendor/golang.org/x/text/unicode/norm
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/moul/.cache/go-build"
GOENV="/home/moul/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/moul/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/moul/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/moul/.gvm/gos/go1.15.5"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/moul/.gvm/gos/go1.15.5/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/moul/go/src/berty.tech/berty/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build449484491=/tmp/go-build -gno-record-gcc-switches"

And this is the one used by the CI:

  • https://github.com/berty/berty/blob/master/.github/workflows/protobuf.yml#L69-L70
  • which uses https://github.com/berty/berty/blob/master/tool/docker-protoc/Dockerfile
$ docker run bertytech/protoc:25 go list std
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build103086107=/tmp/go-build -gno-record-gcc-switches"
$ docker run bertytech/protoc:25 go version
go version go1.14.3 linux/amd64

just noticed this one is not using latest go :)

$ docker run bertytech/protoc:25 go list std
archive/tar
archive/zip
bufio
bytes
compress/bzip2
compress/flate
compress/gzip
compress/lzw
compress/zlib
container/heap
container/list
container/ring
context
crypto
crypto/aes
crypto/cipher
crypto/des
crypto/dsa
crypto/ecdsa
crypto/ed25519
crypto/ed25519/internal/edwards25519
crypto/elliptic
crypto/hmac
crypto/internal/randutil
crypto/internal/subtle
crypto/md5
crypto/rand
crypto/rc4
crypto/rsa
crypto/sha1
crypto/sha256
crypto/sha512
crypto/subtle
crypto/tls
crypto/x509
crypto/x509/pkix
database/sql
database/sql/driver
debug/dwarf
debug/elf
debug/gosym
debug/macho
debug/pe
debug/plan9obj
encoding
encoding/ascii85
encoding/asn1
encoding/base32
encoding/base64
encoding/binary
encoding/csv
encoding/gob
encoding/hex
encoding/json
encoding/pem
encoding/xml
errors
expvar
flag
fmt
go/ast
go/build
go/constant
go/doc
go/format
go/importer
go/internal/gccgoimporter
go/internal/gcimporter
go/internal/srcimporter
go/parser
go/printer
go/scanner
go/token
go/types
hash
hash/adler32
hash/crc32
hash/crc64
hash/fnv
hash/maphash
html
html/template
image
image/color
image/color/palette
image/draw
image/gif
image/internal/imageutil
image/jpeg
image/png
index/suffixarray
internal/bytealg
internal/cfg
internal/cpu
internal/fmtsort
internal/goroot
internal/goversion
internal/lazyregexp
internal/lazytemplate
internal/nettrace
internal/obscuretestdata
internal/oserror
internal/poll
internal/race
internal/reflectlite
internal/singleflight
internal/syscall/execenv
internal/syscall/unix
internal/testenv
internal/testlog
internal/trace
internal/xcoff
io
io/ioutil
log
log/syslog
math
math/big
math/bits
math/cmplx
math/rand
mime
mime/multipart
mime/quotedprintable
net
net/http
net/http/cgi
net/http/cookiejar
net/http/fcgi
net/http/httptest
net/http/httptrace
net/http/httputil
net/http/internal
net/http/pprof
net/internal/socktest
net/mail
net/rpc
net/rpc/jsonrpc
net/smtp
net/textproto
net/url
os
os/exec
os/signal
os/signal/internal/pty
os/user
path
path/filepath
plugin
reflect
regexp
regexp/syntax
runtime
runtime/cgo
runtime/debug
runtime/internal/atomic
runtime/internal/math
runtime/internal/sys
runtime/pprof
runtime/pprof/internal/profile
runtime/race
runtime/trace
sort
strconv
strings
sync
sync/atomic
syscall
testing
testing/internal/testdeps
testing/iotest
testing/quick
text/scanner
text/tabwriter
text/template
text/template/parse
time
unicode
unicode/utf16
unicode/utf8
unsafe
vendor/golang.org/x/crypto/chacha20
vendor/golang.org/x/crypto/chacha20poly1305
vendor/golang.org/x/crypto/cryptobyte
vendor/golang.org/x/crypto/cryptobyte/asn1
vendor/golang.org/x/crypto/curve25519
vendor/golang.org/x/crypto/hkdf
vendor/golang.org/x/crypto/internal/subtle
vendor/golang.org/x/crypto/poly1305
vendor/golang.org/x/net/dns/dnsmessage
vendor/golang.org/x/net/http/httpguts
vendor/golang.org/x/net/http/httpproxy
vendor/golang.org/x/net/http2/hpack
vendor/golang.org/x/net/idna
vendor/golang.org/x/net/nettest
vendor/golang.org/x/sys/cpu
vendor/golang.org/x/text/secure/bidirule
vendor/golang.org/x/text/transform
vendor/golang.org/x/text/unicode/bidi
vendor/golang.org/x/text/unicode/norm
moul

comment created time in 8 days

issue commentdaixiang0/gci

upgrading to v0.2.5 results in `exit 1` without any other change

I understand that, but can you run the commands go list std and go env and post the results? I'm trying to figure out why it is failing.

moul

comment created time in 8 days

issue commentdaixiang0/gci

upgrading to v0.2.5 results in `exit 1` without any other change

main branch is using 0.2.4 and is working well

the issue is on https://github.com/berty/berty/pull/2771 which is not yet merged since it breaks :)

moul

comment created time in 8 days

issue commentdaixiang0/gci

upgrading to v0.2.5 results in `exit 1` without any other change

@moul whenn I checkout the main branch of the berty.tech project, I get different results:

`10:27:19 karl@kaos:~/projects/temp/berty$ go run github.com/daixiang0/gci -d -local berty.tech . go: downloading github.com/daixiang0/gci v0.2.4 skip file go/cmd/berty/doc.go since no import skip file go/cmd/berty/mini/doc.go since no import skip file go/cmd/berty/mini/example_test.go since no import skip file go/cmd/berty-doctor/example_test.go since no import skip file go/cmd/betabot/example_test.go since no import skip file go/cmd/rdvp/doc.go since no import skip file go/cmd/rdvp/example_test.go since no import skip file go/cmd/testbot/example_test.go since no import skip file go/framework/bertybridge/config.go since no import skip file go/framework/bertybridge/config_android.go since no import skip file go/framework/bertybridge/doc.go since no import skip file go/internal/ble-driver/const.go since no import skip file go/internal/ble-driver/example_test.go since no import skip file go/internal/cryptoutil/doc.go since no import skip file go/internal/discordlog/doc.go since no import skip file go/internal/grpcutil/doc.go since no import skip file go/internal/handshake/doc.go since no import skip file go/internal/initutil/tor_embedded.go since no import skip file go/internal/initutil/tor_unembedded.go since no import skip file go/internal/ipfsutil/doc.go since no import skip file go/internal/ipfsutil/metrics.go since no import skip file go/internal/lifecycle/example_test.go since no import skip file go/internal/multipeer-connectivity-driver/const.go since no import skip file go/internal/multipeer-connectivity-driver/example_test.go since no import skip file go/internal/notification/example_test.go since no import skip file go/internal/notification/manager.go since no import skip file go/internal/notification/manager_noop.go since no import skip file go/internal/packingutil/example_test.go since no import skip file go/internal/proximity-transport/addr.go since no import skip file go/internal/proximity-transport/example_test.go since no import skip file go/internal/proximity-transport/nativedriver.go since no import skip file go/internal/sysutil/sysutil_unsupported.go since no import skip file go/internal/testutil/doc.go since no import skip file go/internal/testutil/example_test.go since no import skip file go/internal/tinder/doc.go since no import skip file go/internal/tools/example_test.go since no import skip file go/internal/tools/tools_untool.go since no import skip file go/pkg/assets/embed.go since no import skip file go/pkg/assets/example_test.go since no import skip file go/pkg/banner/doc.go since no import skip file go/pkg/bertybot/commands.go since no import skip file go/pkg/bertymessenger/doc.go since no import skip file go/pkg/bertyprotocol/doc.go since no import skip file go/pkg/bertyprotocol/services_auth_templates.go since no import skip file go/pkg/bertytypes/config.go since no import skip file go/pkg/bertytypes/doc.go since no import skip file go/pkg/bertytypes/events_account.go since no import skip file go/pkg/bertytypes/example_test.go since no import skip file go/pkg/bertyversion/example_test.go since no import skip file go/pkg/bertyversion/version.go since no import skip file go/pkg/errcode/doc.go since no import skip file go/pkg/errcode/stdproto.go since no import skip file go/pkg/tempdir/tempdir.go since no import skip file go/pkg/tempdir/tempdir_darwin.go since no import skip file go/pkg/tempdir/tempdir_others.go since no import skip file go/pkg/username/android.go since no import skip file go/pkg/username/example_test.go since no import skip file go/pkg/username/ios.go since no import skip file go/pkg/username/others.go since no import skip file go/pkg/username/username.go since no import skip file tool/test/experiment/dht/dht.go since no import diff -u tool/test/experiment/dht/src/matrix/dht.go.orig tool/test/experiment/dht/src/matrix/dht.go --- tool/test/experiment/dht/src/matrix/dht.go.orig 2020-11-20 10:31:01.000000000 +0100 +++ tool/test/experiment/dht/src/matrix/dht.go 2020-11-20 10:31:01.000000000 +0100 @@ -4,10 +4,10 @@ "encoding/json" "fmt"

  • "github.com/matrix-org/gomatrix" "github.com/pkg/errors"

    "berty.tech/berty/experiment/dht"

  • "github.com/matrix-org/gomatrix" )

var _ dht.DHT = (*DHT)(nil) diff -u tool/test/experiment/dht/test/basic_test.go.orig tool/test/experiment/dht/test/basic_test.go --- tool/test/experiment/dht/test/basic_test.go.orig 2020-11-20 10:31:02.000000000 +0100 +++ tool/test/experiment/dht/test/basic_test.go 2020-11-20 10:31:02.000000000 +0100 @@ -3,13 +3,14 @@ import ( "testing"

  • . "github.com/smartystreets/goconvey/convey"
  • "berty.tech/berty/experiment/dht" "berty.tech/berty/experiment/dht/src/bittorrent" "berty.tech/berty/experiment/dht/src/chord" "berty.tech/berty/experiment/dht/src/gnunet" "berty.tech/berty/experiment/dht/src/libp2p" "berty.tech/berty/experiment/dht/src/matrix"
  • . "github.com/smartystreets/goconvey/convey" )

func TestBasic(t *testing.T) {`

can you run the command go list std on your system and share the results?

moul

comment created time in 8 days

issue openeddaixiang0/gci

upgrading to v0.2.5 results in `exit 1` without any other change

@dependabot tried to automatically update the version of gci we are using -> https://github.com/berty/berty/pull/2771


It results in gci terminating with exit 1 without any useful logging information:

moul@fwrz:~/go/src/berty.tech/berty/go (dependabot/go_modules/github.com/daixiang0/gci-0.2.5) $ go run github.com/daixiang0/gci -d -local berty.tech .
skip file cmd/berty/doc.go since no import
skip file cmd/berty/mini/doc.go since no import
skip file cmd/berty/mini/example_test.go since no import
skip file cmd/berty-doctor/example_test.go since no import
skip file cmd/betabot/example_test.go since no import
skip file cmd/rdvp/doc.go since no import
[...] // skipping annoying logs
skip file pkg/username/others.go since no import
skip file pkg/username/username.go since no import
exit status 1

I also tried removing the -local option, but still the exit 1 issue


FYI, here is our setup:

  • latest go version
  • go modules
  • canonical URLs (berty.tech/berty is mapped to github.com/berty/berty)
  • we're using the official way of using major versions berty.tech/berty/v2 is not a real folders, but is clearly defined in the go.mod

I'm sorry, I don't have enough knowledge of your project's internals to give you more details, but I think this comes from https://github.com/daixiang0/gci/pull/22

Thank you very much, and take care

created time in 8 days

starteddaixiang0/gci

started time in 10 days

starteddaixiang0/gci

started time in 10 days

starteddaixiang0/gci

started time in 10 days

pull request commentdaixiang0/gci

allow non-URL local package names

After adding the tests, I discovered there was no way to differentiate non-URL package names from standard library package names - if the non-URL package name was from an external package. Therefore, this PR is now bigger than I intended yet foolproof - the list of stdlib package names will be loaded upon start and used to classify stdlib package names.

kwo

comment created time in 11 days

PR opened daixiang0/gci

allow non-URL local package names

Allow local package names that are a single word or not a URL.

Fixes #17

+4 -5

0 comment

1 changed file

pr created time in 11 days

PR closed daixiang0/gci

allow non-URL local package names

Signed-off-by: Karl Ostendorf karl@ostendorf.com, fixes #17

+4 -5

0 comment

1 changed file

kwo

pr closed time in 11 days

more