From 5f221b466eb5a264ee52c15c3d77b3266c544724 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Thu, 12 Dec 2019 20:02:57 -0700 Subject: [PATCH] Report if the team ID is already registered --- cmd/mothd/state.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/mothd/state.go b/cmd/mothd/state.go index c855264..775bf85 100644 --- a/cmd/mothd/state.go +++ b/cmd/mothd/state.go @@ -134,6 +134,9 @@ func (s *State) SetTeamName(teamId string, teamName string) error { teamFile := filepath.Join("teams", teamId) err := afero.WriteFile(s.fs, teamFile, []byte(teamName), os.ModeExclusive|0644) + if os.IsExist(err) { + return fmt.Errorf("Team ID is already registered") + } return err }