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

Fix building and passing tests #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xaionaro
Copy link

@xaionaro xaionaro commented Aug 2, 2024

Before

xaionaro@void:~/go/src/github.com/xaionaro-go/logrustash$ go test ./... -test.count=1
pattern ./...: directory prefix . does not contain main module or its selected dependencies
xaionaro@void:~/go/src/github.com/xaionaro-go/logrustash$ go mod init
go: creating new go.mod: module github.com/xaionaro-go/logrustash
go: to add module requirements and sums:
	go mod tidy
xaionaro@void:~/go/src/github.com/xaionaro-go/logrustash$ go mod tidy
go: finding module for package github.com/sirupsen/logrus
go: finding module for package github.com/teh-cmc/goautosocket
go: found github.com/sirupsen/logrus in github.com/sirupsen/logrus v1.9.3
go: finding module for package github.com/teh-cmc/goautosocket
go: github.com/xaionaro-go/logrustash imports
	github.com/teh-cmc/goautosocket: cannot find module providing package github.com/teh-cmc/goautosocket: module github.com/teh-cmc/goautosocket: git ls-remote -q origin in /home/xaionaro/.gvm/pkgsets/go1.22.1/global/pkg/mod/cache/vcs/9b99942761a13c552cfdbd0877837e4cec83bdc7a231c9c0224ba501b36d1e77: exit status 128:
	fatal: could not read Username for 'https://github.com': terminal prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.
xaionaro@void:~/go/src/github.com/xaionaro-go/logrustash$ sed -e 's/teh-cmc/netbrain/g' -i logstash.go
xaionaro@void:~/go/src/github.com/xaionaro-go/logrustash$ go mod tidy
go: finding module for package github.com/sirupsen/logrus
go: finding module for package github.com/netbrain/goautosocket
go: found github.com/netbrain/goautosocket in github.com/netbrain/goautosocket v0.0.0-20150624145746-bef85f0aef40
go: found github.com/sirupsen/logrus in github.com/sirupsen/logrus v1.9.3
xaionaro@void:~/go/src/github.com/xaionaro-go/logrustash$ go test ./... -test.count=1
--- FAIL: TestLogstashFormatter (0.00s)
    logstash_formatter_test.go:58: expected data[error] to be 'Get http://example.com: The error' but got 'Get "http://example.com": The error'
--- FAIL: TestLogstashHook (0.00s)
    logstash_test.go:90: unknown network udp
    logstash_test.go:93: expected hook to be not nil
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x570f3a]

goroutine 7 [running]:
testing.tRunner.func1.2({0x592f80, 0x711f40})
	/home/xaionaro/.gvm/gos/go1.22.1/src/testing/testing.go:1631 +0x24a
testing.tRunner.func1()
	/home/xaionaro/.gvm/gos/go1.22.1/src/testing/testing.go:1634 +0x377
panic({0x592f80?, 0x711f40?})
	/home/xaionaro/.gvm/gos/go1.22.1/src/runtime/panic.go:770 +0x132
github.com/xaionaro-go/logrustash.TestLogstashHook(0xc0000d0680)
	/home/xaionaro/go/src/github.com/xaionaro-go/logrustash/logstash_test.go:96 +0x55a
testing.tRunner(0xc0000d0680, 0x5d0e90)
	/home/xaionaro/.gvm/gos/go1.22.1/src/testing/testing.go:1689 +0xfb
created by testing.(*T).Run in goroutine 1
	/home/xaionaro/.gvm/gos/go1.22.1/src/testing/testing.go:1742 +0x390
FAIL	github.com/xaionaro-go/logrustash	0.006s
FAIL

After

xaionaro@void:~/go/src/github.com/xaionaro-go/logrustash$ go test ./... -test.count=1
ok  	github.com/xaionaro-go/logrustash	0.005s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant