// Copyright 2017 The Gogs Authors. All rights reserved.// Use of this source code is governed by a MIT-style// license that can be found in the LICENSE file.packageerrorsimport"fmt"typeEmptyNamestruct{}funcIsEmptyName(errerror)bool{_,ok:=err.(EmptyName)returnok}func(errEmptyName)Error()string{return"empty name"}typeUserNotExiststruct{UserIDint64Namestring}funcIsUserNotExist(errerror)bool{_,ok:=err.(UserNotExist)returnok}func(errUserNotExist)Error()string{returnfmt.Sprintf("user does not exist [user_id: %d, name: %s]",err.UserID,err.Name)}typeUserNotKeyOwnerstruct{KeyIDint64}funcIsUserNotKeyOwner(errerror)bool{_,ok:=err.(UserNotKeyOwner)returnok}func(errUserNotKeyOwner)Error()string{returnfmt.Sprintf("user is not the owner of public key [key_id: %d]",err.KeyID)}