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

uuid: use plain package instead of module #135

Merged
merged 1 commit into from
Jan 31, 2022

Conversation

DifferentialOrange
Copy link
Member

Using separate module instead of plain package introduced several
issues related to dependencies inside the repository (see #134).
At the same time, same functionality could be provided with package.
The only drawback is that google/uuid will be included in main
package dependency even if user decide to use custom UUID parser or
ignore UUID completely.

Closes #134

Using separate module instead of plain package introduced several
issues related to dependencies inside the repository (see #134).
At the same time, same functionality could be provided with package.
The only drawback is that google/uuid will be included in main
package dependency even if user decide to use custom UUID parser or
ignore UUID completely.

Closes #134
@DifferentialOrange
Copy link
Member Author

DifferentialOrange commented Jan 14, 2022

If UUID is not included, UUID is not supported (thus decoders and encoders are not set):

go test uuid_test.go 
--- FAIL: TestSelect (0.00s)
    uuid_test.go:103: UUID select failed: Supplied key type of part 0 does not match index part type: expected uuid (0x12)
    uuid_test.go:75: Response Data len != 1
panic: runtime error: index out of range [0] with length 0 [recovered]
	panic: runtime error: index out of range [0] with length 0

goroutine 19 [running]:
testing.tRunner.func1.2({0x579b80, 0xc00018e060})
	/usr/local/go/src/testing/testing.go:1209 +0x24e
testing.tRunner.func1()
	/usr/local/go/src/testing/testing.go:1212 +0x218
panic({0x579b80, 0xc00018e060})
	/usr/local/go/src/runtime/panic.go:1038 +0x215
command-line-arguments_test.tupleValueIsId(0xc000083520, {0x0, 0x0, 0x55a220}, {0xc8, 0xf0, 0xfa, 0x1f, 0xda, 0x29, ...})
	/home/georgymoiseev/Development/github/tarantool/go-tarantool/uuid_test.go:78 +0x1c6
command-line-arguments_test.TestSelect(0xc000083520)
	/home/georgymoiseev/Development/github/tarantool/go-tarantool/uuid_test.go:108 +0x2b7
testing.tRunner(0xc000083520, 0x594960)
	/usr/local/go/src/testing/testing.go:1259 +0x102
created by testing.(*T).Run
	/usr/local/go/src/testing/testing.go:1306 +0x35a
FAIL	command-line-arguments	0.005s
FAIL

To test it, you'll need to move uuid_test.go to main folder, rename package from uuid_testto tarantool_test (otherwise Go will not run them) and comment _ "github.com/tarantool/go-tarantool/uuid" import.

We may add a negative test (UUID is not supported if import not added), but I'm not sure we need it.

Copy link
Member

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I don't see any downsides.

@DifferentialOrange DifferentialOrange merged commit 56cb3ef into master Jan 31, 2022
@DifferentialOrange DifferentialOrange deleted the DifferentialOrange/gh-134-fix-mod-deps branch January 31, 2022 08:29
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.

UUID submodule dependency is broken
3 participants