golang: Install go.mod/go.sum by default
authorJeffery To <redacted>
Sat, 9 Feb 2019 12:00:56 +0000 (20:00 +0800)
committerJeffery To <redacted>
Mon, 11 Feb 2019 12:33:45 +0000 (20:33 +0800)
Signed-off-by: Jeffery To <redacted>
lang/golang/golang-package.mk

index 3c1137b94d5d2378e6826c0b44024cf4c40ee15e..887d54dadc522956dc8fd6892775c476f58c4ae0 100644 (file)
@@ -32,6 +32,8 @@ include $(GO_INCLUDE_DIR)/golang-values.mk
 #
 #   * Files in any 'testdata' directory
 #
+#   * go.mod and go.sum, in any directory
+#
 #   e.g. GO_PKG_INSTALL_EXTRA:=example.toml marshal_test.toml
 #
 #
@@ -155,12 +157,13 @@ define GoPackage/Build/Configure
                if [ "$(GO_PKG_INSTALL_ALL)" != 1 ]; then \
                        code=$$$$(echo "$$$$files" | grep '\.\(c\|cc\|cpp\|go\|h\|hh\|hpp\|proto\|s\)$$$$') ; \
                        testdata=$$$$(echo "$$$$files" | grep '\(^\|/\)testdata/') ; \
+                       gomod=$$$$(echo "$$$$files" | grep '\(^\|/\)go\.\(mod\|sum\)$$$$') ; \
                        \
                        for pattern in $(GO_PKG_INSTALL_EXTRA); do \
                                extra=$$$$(echo "$$$$extra"; echo "$$$$files" | grep "$$$$pattern") ; \
                        done ; \
                        \
-                       files=$$$$(echo "$$$$code"; echo "$$$$testdata"; echo "$$$$extra") ; \
+                       files=$$$$(echo "$$$$code"; echo "$$$$testdata"; echo "$$$$gomod"; echo "$$$$extra") ; \
                        files=$$$$(echo "$$$$files" | grep -v '^[[:space:]]*$$$$' | sort -u) ; \
                fi ; \
                \
git clone https://git.99rst.org/PROJECT