Skip to content

symlink: drop go 1.13, and use testing.Cleanup()#55

Merged
cpuguy83 merged 1 commit intomoby:masterfrom
thaJeztah:simplify_utils
Feb 25, 2021
Merged

symlink: drop go 1.13, and use testing.Cleanup()#55
cpuguy83 merged 1 commit intomoby:masterfrom
thaJeztah:simplify_utils

Conversation

@thaJeztah
Copy link
Member

Cleanup was added in Go 1.14, so we need to drop go 1.13 for this.

@thaJeztah
Copy link
Member Author

relates to #54 (comment)

/cc @kolyshkin

func TestFollowSymlinkAbsolute(t *testing.T) {
tmpdir, cleanup := mkTempDir(t)
defer cleanup()
tmpdir := mkTempDir(t)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why don't we use t.TempDir() here? https://golang.org/pkg/testing/#T.TempDir

Ahh, this is because they are only supported since 1.15, so we need to wait at least until 1.14 is no longer supported.

Makes sense to add a TODO maybe?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, yes, can add a TODO

(didn't know about the t.TempDir() until you mentioned it recently. I should catch up more on new features 😂)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can't use this shiny new t.TempDir() anyway until 1.14 goes out of fashion...

Cleanup was added in Go 1.14, so we need to drop go 1.13
for this.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Copy link
Collaborator

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

LGTM except for a missing TODO

Copy link
Collaborator

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

LGTM

@kolyshkin
Copy link
Collaborator

@cpuguy83 PTAL

1 similar comment
@kolyshkin
Copy link
Collaborator

@cpuguy83 PTAL

Copy link
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

LGTM

@cpuguy83 cpuguy83 merged commit 4836a5f into moby:master Feb 25, 2021
@thaJeztah thaJeztah deleted the simplify_utils branch February 25, 2021 01:07
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.

3 participants