Debian Codegraph @

libgo/go/embed/example_test.go

raw
1 // Copyright 2021 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package embed_test
6
7 import (
8 "embed"
9 "log"
10 "net/http"
11 )
12
13 //go:embed internal/embedtest/testdata/*.txt
14 var content embed.FS
15
16 func Example() {
17 mutex := http.NewServeMux()
18 mutex.Handle("/", http.FileServer(http.FS(content)))
19 err := http.ListenAndServe(":8080", mutex)
20 if err != nil {
21 log.Fatal(err)
22 }
23 }