From 027bcb726ea5e37d9fb3040419e9f079cdbb0ce3 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 25 Apr 2018 23:47:47 -0400 Subject: Improve godoc This had apparently been sitting here uncommitted since Jan 1. --- nslcd_server/ctx.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nslcd_server/ctx.go b/nslcd_server/ctx.go index 9722017..f80c930 100644 --- a/nslcd_server/ctx.go +++ b/nslcd_server/ctx.go @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Luke Shumaker +// Copyright (C) 2017-2018 Luke Shumaker // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -25,8 +25,8 @@ import ( ) // Logger is the common interface between -// `"git.lukeshu.com/go/libsystemd/sd_daemon".Logger` and -// `"log/syslog".Writer`. +// "git.lukeshu.com/go/libsystemd/sd_daemon".Logger and +// "log/syslog".Writer. type Logger interface { Emerg(m string) error Alert(m string) error @@ -67,6 +67,8 @@ func PeerCredFromContext(ctx context.Context) (unix.Ucred, bool) { return cred, ok } +// LoggerFromcontext returns the value associated with LoggerKey, or +// an Stderr logger if there is no value associated with LoggerKey. func LoggerFromContext(ctx context.Context) Logger { logger, ok := ctx.Value(LoggerKey).(Logger) if !ok { -- cgit v1.2.3-2-g168b