mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-22 15:27:02 +00:00
docs: Add missing docstrings, adjust wording to match standard style
This patch adds a missing docstrings for exported identifiers, and adjust some of the existing ones to match the standard style. In some cases, the identifiers were un-exported after noticing they had no external users. Besides improving documentation, it also reduces the linter noise significantly.
This commit is contained in:
@@ -19,16 +19,19 @@ func Split(addr string) (string, string) {
|
||||
return ps[0], ps[1]
|
||||
}
|
||||
|
||||
// UserOf user@domain returns user.
|
||||
func UserOf(addr string) string {
|
||||
user, _ := Split(addr)
|
||||
return user
|
||||
}
|
||||
|
||||
// DomainOf user@domain returns domain.
|
||||
func DomainOf(addr string) string {
|
||||
_, domain := Split(addr)
|
||||
return domain
|
||||
}
|
||||
|
||||
// DomainIn checks that the domain of the address is on the given set.
|
||||
func DomainIn(addr string, locals *set.String) bool {
|
||||
domain := DomainOf(addr)
|
||||
if domain == "" {
|
||||
@@ -38,6 +41,7 @@ func DomainIn(addr string, locals *set.String) bool {
|
||||
return locals.Has(domain)
|
||||
}
|
||||
|
||||
// AddHeader adds (prepends) a MIME header to the message.
|
||||
func AddHeader(data []byte, k, v string) []byte {
|
||||
if len(v) > 0 {
|
||||
// If the value contains newlines, indent them properly.
|
||||
|
||||
Reference in New Issue
Block a user