package game import ( "fmt" ) func (gm *Game) SaveQuote(fileName, usrId, quoteId, quoteText string) error { quote, err := gm.getQuoteById(quoteId) if err != nil { return err } if quote.GetSourceId() != usrId { return fmt.Errorf("usrId does not match quote source id") } quote.SetQuote(quoteText) return quote.Save(fileName) }