gofmt GoDoc comments with go1.19

Older versions of Go don't format comments, so committing this as
a separate commit, so that we can already make these changes before
we upgrade to Go 1.19.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 52c1a2fae8)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2022-07-08 18:27:07 +02:00
parent c52e221207
commit cdbca4061b
55 changed files with 415 additions and 389 deletions

View File

@@ -93,9 +93,10 @@ func (s *DockerCLICpSuite) TestCpFromSymlinkDestination(c *testing.T) {
// J | yes | yes | yes | yes | - | copy dir contents
//
// A. SRC specifies a file and DST (no trailing path separator) doesn't
// exist. This should create a file with the name DST and copy the
// contents of the source file into it.
// A. SRC specifies a file and DST (no trailing path separator) doesn't exist.
//
// This should create a file with the name DST and copy the contents of the
// source file into it.
func (s *DockerCLICpSuite) TestCpFromCaseA(c *testing.T) {
testRequires(c, DaemonIsLinux)
containerID := makeTestContainer(c, testContainerOptions{
@@ -112,9 +113,10 @@ func (s *DockerCLICpSuite) TestCpFromCaseA(c *testing.T) {
assert.NilError(c, fileContentEquals(c, dstPath, "file1\n"))
}
// B. SRC specifies a file and DST (with trailing path separator) doesn't
// exist. This should cause an error because the copy operation cannot
// create a directory when copying a single file.
// B. SRC specifies a file and DST (with trailing path separator) doesn't exist.
//
// This should cause an error because the copy operation cannot create a directory
// when copying a single file.
func (s *DockerCLICpSuite) TestCpFromCaseB(c *testing.T) {
testRequires(c, DaemonIsLinux)
containerID := makeTestContainer(c, testContainerOptions{addContent: true})
@@ -130,8 +132,9 @@ func (s *DockerCLICpSuite) TestCpFromCaseB(c *testing.T) {
assert.Assert(c, isCpDirNotExist(err), "expected DirNotExists error, but got %T: %s", err, err)
}
// C. SRC specifies a file and DST exists as a file. This should overwrite
// the file at DST with the contents of the source file.
// C. SRC specifies a file and DST exists as a file.
//
// This should overwrite the file at DST with the contents of the source file.
func (s *DockerCLICpSuite) TestCpFromCaseC(c *testing.T) {
testRequires(c, DaemonIsLinux)
containerID := makeTestContainer(c, testContainerOptions{
@@ -152,9 +155,10 @@ func (s *DockerCLICpSuite) TestCpFromCaseC(c *testing.T) {
assert.NilError(c, fileContentEquals(c, dstPath, "file1\n"))
}
// D. SRC specifies a file and DST exists as a directory. This should place
// a copy of the source file inside it using the basename from SRC. Ensure
// this works whether DST has a trailing path separator or not.
// D. SRC specifies a file and DST exists as a directory.
//
// This should place a copy of the source file inside it using the basename from
// SRC. Ensure this works whether DST has a trailing path separator or not.
func (s *DockerCLICpSuite) TestCpFromCaseD(c *testing.T) {
testRequires(c, DaemonIsLinux)
containerID := makeTestContainer(c, testContainerOptions{addContent: true})
@@ -186,10 +190,11 @@ func (s *DockerCLICpSuite) TestCpFromCaseD(c *testing.T) {
assert.NilError(c, fileContentEquals(c, dstPath, "file1\n"))
}
// E. SRC specifies a directory and DST does not exist. This should create a
// directory at DST and copy the contents of the SRC directory into the DST
// directory. Ensure this works whether DST has a trailing path separator or
// not.
// E. SRC specifies a directory and DST does not exist.
//
// This should create a directory at DST and copy the contents of the SRC directory
// into the DST directory. Ensure this works whether DST has a trailing path
// separator or not.
func (s *DockerCLICpSuite) TestCpFromCaseE(c *testing.T) {
testRequires(c, DaemonIsLinux)
containerID := makeTestContainer(c, testContainerOptions{addContent: true})
@@ -214,8 +219,10 @@ func (s *DockerCLICpSuite) TestCpFromCaseE(c *testing.T) {
assert.NilError(c, fileContentEquals(c, dstPath, "file1-1\n"))
}
// F. SRC specifies a directory and DST exists as a file. This should cause an
// error as it is not possible to overwrite a file with a directory.
// F. SRC specifies a directory and DST exists as a file.
//
// This should cause an error as it is not possible to overwrite a file with a
// directory.
func (s *DockerCLICpSuite) TestCpFromCaseF(c *testing.T) {
testRequires(c, DaemonIsLinux)
containerID := makeTestContainer(c, testContainerOptions{
@@ -235,9 +242,10 @@ func (s *DockerCLICpSuite) TestCpFromCaseF(c *testing.T) {
assert.Assert(c, isCpCannotCopyDir(err), "expected ErrCannotCopyDir error, but got %T: %s", err, err)
}
// G. SRC specifies a directory and DST exists as a directory. This should copy
// the SRC directory and all its contents to the DST directory. Ensure this
// works whether DST has a trailing path separator or not.
// G. SRC specifies a directory and DST exists as a directory.
//
// This should copy the SRC directory and all its contents to the DST directory.
// Ensure this works whether DST has a trailing path separator or not.
func (s *DockerCLICpSuite) TestCpFromCaseG(c *testing.T) {
testRequires(c, DaemonIsLinux)
containerID := makeTestContainer(c, testContainerOptions{
@@ -268,10 +276,11 @@ func (s *DockerCLICpSuite) TestCpFromCaseG(c *testing.T) {
assert.NilError(c, fileContentEquals(c, dstPath, "file1-1\n"))
}
// H. SRC specifies a directory's contents only and DST does not exist. This
// should create a directory at DST and copy the contents of the SRC
// directory (but not the directory itself) into the DST directory. Ensure
// this works whether DST has a trailing path separator or not.
// H. SRC specifies a directory's contents only and DST does not exist.
//
// This should create a directory at DST and copy the contents of the SRC
// directory (but not the directory itself) into the DST directory. Ensure
// this works whether DST has a trailing path separator or not.
func (s *DockerCLICpSuite) TestCpFromCaseH(c *testing.T) {
testRequires(c, DaemonIsLinux)
containerID := makeTestContainer(c, testContainerOptions{addContent: true})
@@ -296,9 +305,10 @@ func (s *DockerCLICpSuite) TestCpFromCaseH(c *testing.T) {
assert.NilError(c, fileContentEquals(c, dstPath, "file1-1\n"))
}
// I. SRC specifies a directory's contents only and DST exists as a file. This
// should cause an error as it is not possible to overwrite a file with a
// directory.
// I. SRC specifies a directory's contents only and DST exists as a file.
//
// This should cause an error as it is not possible to overwrite a file with a
// directory.
func (s *DockerCLICpSuite) TestCpFromCaseI(c *testing.T) {
testRequires(c, DaemonIsLinux)
containerID := makeTestContainer(c, testContainerOptions{
@@ -319,9 +329,10 @@ func (s *DockerCLICpSuite) TestCpFromCaseI(c *testing.T) {
}
// J. SRC specifies a directory's contents only and DST exists as a directory.
// This should copy the contents of the SRC directory (but not the directory
// itself) into the DST directory. Ensure this works whether DST has a
// trailing path separator or not.
//
// This should copy the contents of the SRC directory (but not the directory
// itself) into the DST directory. Ensure this works whether DST has a
// trailing path separator or not.
func (s *DockerCLICpSuite) TestCpFromCaseJ(c *testing.T) {
testRequires(c, DaemonIsLinux)
containerID := makeTestContainer(c, testContainerOptions{