From 59c2d787d30052afaa4eb627130475bae12fb831 Mon Sep 17 00:00:00 2001 From: Michael Matloob Date: Tue, 18 Apr 2023 12:16:43 -0400 Subject: [PATCH] src/internal/godebugs: add a skip for missing godebug.md Currently android doesn't include godebug.md in its doc folder, and TestAll in godebugs_test.go is failing because it can't open the file. Add a skip in case the file is missing (except for linux so we can catch the case where we stop generating the file). Change-Id: I37a711e49a494c33bc92bf3e31cf40471ea9d5b6 Reviewed-on: https://go-review.googlesource.com/c/go/+/485795 Run-TryBot: Michael Matloob Reviewed-by: Bryan Mills Auto-Submit: Bryan Mills Reviewed-by: Michael Matloob TryBot-Result: Gopher Robot --- src/internal/godebugs/godebugs_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/internal/godebugs/godebugs_test.go b/src/internal/godebugs/godebugs_test.go index 663268f02b..a1cb8d492a 100644 --- a/src/internal/godebugs/godebugs_test.go +++ b/src/internal/godebugs/godebugs_test.go @@ -6,7 +6,9 @@ package godebugs_test import ( "internal/godebugs" + "internal/testenv" "os" + "runtime" "strings" "testing" ) @@ -14,6 +16,9 @@ import ( func TestAll(t *testing.T) { data, err := os.ReadFile("../../../doc/godebug.md") if err != nil { + if os.IsNotExist(err) && (testenv.Builder() == "" || runtime.GOOS != "linux") { + t.Skip(err) + } t.Fatal(err) } doc := string(data) -- 2.48.1