From 83197b1ebb1c15ae0b082e7206eb50df6929fa28 Mon Sep 17 00:00:00 2001 From: idanieldrew Date: Sun, 10 Jul 2022 23:02:25 +0430 Subject: [PATCH] Using types intstead of several type in auth file --- auth.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/auth.go b/auth.go index 2503c515..06e6a0ee 100644 --- a/auth.go +++ b/auth.go @@ -16,15 +16,17 @@ import ( // AuthUserKey is the cookie name for user credential in basic auth. const AuthUserKey = "user" -// Accounts defines a key/value for user/pass list of authorized logins. -type Accounts map[string]string +type ( + // Accounts defines a key/value for user/pass list of authorized logins. + Accounts map[string]string -type authPair struct { - value string - user string -} + authPair struct { + value string + user string + } -type authPairs []authPair + authPairs []authPair +) func (a authPairs) searchCredential(authValue string) (string, bool) { if authValue == "" {