From 7465e07e394e095f3a93abe56024b77802371a4e Mon Sep 17 00:00:00 2001 From: qiulaidongfeng <2645477756@qq.com> Date: Sat, 12 Aug 2023 16:48:56 +0800 Subject: [PATCH 1/3] embed: document go.mod exclusion Fixes: #45197 Change-Id: I61dff71ba02bfafd054408d73b8a15db745d0198 --- src/embed/embed.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/embed/embed.go b/src/embed/embed.go index b7bb16099e56a1..0772900b8df287 100644 --- a/src/embed/embed.go +++ b/src/embed/embed.go @@ -94,6 +94,7 @@ // Patterns must not match files whose names include the special punctuation characters " * < > ? ` ' | / \ and :. // Matches for empty directories are ignored. After that, each pattern in a //go:embed line // must match at least one file or non-empty directory. +// If a non empty directory is matched, there must be no files with the name go.mod in the matching directory. // // If any patterns are invalid or have invalid matches, the build will fail. // From 4d08f35a3746aa49b2109d463e28515cf12a02fa Mon Sep 17 00:00:00 2001 From: qiulaidongfeng <2645477756@qq.com> Date: Sun, 31 Dec 2023 15:31:09 +0800 Subject: [PATCH 2/3] Revert "embed: document go.mod exclusion" This reverts commit 34099cd2ec03405008c096bc5bfa55377fa4e9a3. --- src/embed/embed.go | 1 - 1 file changed, 1 deletion(-) diff --git a/src/embed/embed.go b/src/embed/embed.go index 0772900b8df287..b7bb16099e56a1 100644 --- a/src/embed/embed.go +++ b/src/embed/embed.go @@ -94,7 +94,6 @@ // Patterns must not match files whose names include the special punctuation characters " * < > ? ` ' | / \ and :. // Matches for empty directories are ignored. After that, each pattern in a //go:embed line // must match at least one file or non-empty directory. -// If a non empty directory is matched, there must be no files with the name go.mod in the matching directory. // // If any patterns are invalid or have invalid matches, the build will fail. // From bb45fc5b2759313c9860055e803df58d4e47e438 Mon Sep 17 00:00:00 2001 From: qiulaidongfeng <2645477756@qq.com> Date: Sun, 31 Dec 2023 15:39:47 +0800 Subject: [PATCH 3/3] 2 --- src/embed/embed.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/embed/embed.go b/src/embed/embed.go index b7bb16099e56a1..3663c39fc65048 100644 --- a/src/embed/embed.go +++ b/src/embed/embed.go @@ -90,7 +90,8 @@ // depending on whether the package wants to make the data available to other packages. // It can only be used with variables at package scope, not with local variables. // -// Patterns must not match files outside the package's module, such as ‘.git/*’ or symbolic links. +// Patterns must not match files outside the package's module, such as ‘.git/*’ or symbolic links +// or a directory contains the go.mod file. // Patterns must not match files whose names include the special punctuation characters " * < > ? ` ' | / \ and :. // Matches for empty directories are ignored. After that, each pattern in a //go:embed line // must match at least one file or non-empty directory.