aboutsummaryrefslogtreecommitdiff
path: root/internal/stdlib/testdata/dev.fuzz/src/errors/errors.go
diff options
context:
space:
mode:
authorJulie Qiu <julie@golang.org>2021-06-23 16:36:40 -0700
committerJulie Qiu <julie@golang.org>2021-07-12 21:13:20 +0000
commite6b30bf2f78149bbea1ef607321cdeed1010abc5 (patch)
treefe76ed9ca0f6a83124a1130e797c2da10c04fcfc /internal/stdlib/testdata/dev.fuzz/src/errors/errors.go
parent738f3de8876e8c3c274b30b830ab079466e44ae7 (diff)
downloadgo-x-pkgsite-e6b30bf2f78149bbea1ef607321cdeed1010abc5.tar.xz
internal: support std@dev.fuzz
It is now possible to fetch std@dev.fuzz and view /std@dev.fuzz on the frontend. For golang/go#46910 Change-Id: I2fd7259840ba32ff35ca323d07412988e533ffba Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/330413 Trust: Julie Qiu <julie@golang.org> Run-TryBot: Julie Qiu <julie@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'internal/stdlib/testdata/dev.fuzz/src/errors/errors.go')
-rw-r--r--internal/stdlib/testdata/dev.fuzz/src/errors/errors.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/stdlib/testdata/dev.fuzz/src/errors/errors.go b/internal/stdlib/testdata/dev.fuzz/src/errors/errors.go
new file mode 100644
index 00000000..b8a46921
--- /dev/null
+++ b/internal/stdlib/testdata/dev.fuzz/src/errors/errors.go
@@ -0,0 +1,20 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package errors implements functions to manipulate errors.
+package errors
+
+// New returns an error that formats as the given text.
+func New(text string) error {
+ return &errorString{text}
+}
+
+// errorString is a trivial implementation of error.
+type errorString struct {
+ s string
+}
+
+func (e *errorString) Error() string {
+ return e.s
+}