This repository has been archived on 2023-05-01. You can view files and clone it, but cannot push or open issues or pull requests.
gus/finger/response.go

23 lines
463 B
Go

package finger
import (
"bytes"
"io"
"strings"
"tildegit.org/tjp/gus"
)
// Error produces a finger Response containing the error message and Status 1.
func Error(msg string) *gus.Response {
if !strings.HasSuffix(msg, "\r\n") {
msg += "\r\n"
}
return &gus.Response{Body: bytes.NewBufferString(msg), Status: 1}
}
// Success produces a finger response with a Status of 0.
func Success(body io.Reader) *gus.Response {
return &gus.Response{Body: body}
}