mirror of
https://git.sr.ht/~adnano/go-gemini
synced 2024-09-18 13:31:36 +02:00
Run go fmt
This commit is contained in:
parent
4a694c0eb7
commit
3b101e802d
2
fs.go
2
fs.go
@ -18,7 +18,7 @@ import (
|
|||||||
//
|
//
|
||||||
// To use the operating system's file system implementation, use os.DirFS:
|
// To use the operating system's file system implementation, use os.DirFS:
|
||||||
//
|
//
|
||||||
// gemini.FileServer(os.DirFS("/tmp"))
|
// gemini.FileServer(os.DirFS("/tmp"))
|
||||||
func FileServer(fsys fs.FS) Handler {
|
func FileServer(fsys fs.FS) Handler {
|
||||||
return fileServer{fsys}
|
return fileServer{fsys}
|
||||||
}
|
}
|
||||||
|
29
tofu/tofu.go
29
tofu/tofu.go
@ -102,21 +102,20 @@ func (k *KnownHosts) Load(path string) error {
|
|||||||
// For more control over errors encountered during parsing, use bufio.Scanner
|
// For more control over errors encountered during parsing, use bufio.Scanner
|
||||||
// in combination with ParseHost. For example:
|
// in combination with ParseHost. For example:
|
||||||
//
|
//
|
||||||
// var knownHosts tofu.KnownHosts
|
// var knownHosts tofu.KnownHosts
|
||||||
// scanner := bufio.NewScanner(r)
|
// scanner := bufio.NewScanner(r)
|
||||||
// for scanner.Scan() {
|
// for scanner.Scan() {
|
||||||
// host, err := tofu.ParseHost(scanner.Bytes())
|
// host, err := tofu.ParseHost(scanner.Bytes())
|
||||||
// if err != nil {
|
// if err != nil {
|
||||||
// // handle error
|
// // handle error
|
||||||
// } else {
|
// } else {
|
||||||
// knownHosts.Add(host)
|
// knownHosts.Add(host)
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// err := scanner.Err()
|
// err := scanner.Err()
|
||||||
// if err != nil {
|
// if err != nil {
|
||||||
// // handle error
|
// // handle error
|
||||||
// }
|
// }
|
||||||
//
|
|
||||||
func (k *KnownHosts) Parse(r io.Reader) error {
|
func (k *KnownHosts) Parse(r io.Reader) error {
|
||||||
k.mu.Lock()
|
k.mu.Lock()
|
||||||
defer k.mu.Unlock()
|
defer k.mu.Unlock()
|
||||||
|
Loading…
Reference in New Issue
Block a user