Skip to content

Releases: nekomeowww/fo

v1.4.0

29 Aug 10:47
v1.4.0
2a9cdf2
Compare
Choose a tag to compare
  • feat: new WithZapLoggerFuncHandler for zap logger

Quite useful with zap logger when working with loads of different omitting error handling use cases:

may := fo.NewMay()
may.Use(fo.WithZapLoggerHandler(zapLogger))

may.Invoke(os.Open("./test_file.json"), "failed to open file", zap.String("file", "test_file.json"))

or having this pattern in https://github.com/nekomeowww/insights-bot/blob/967fa028caf356b0a96eaf19d85dcaa2968bbd1f/internal/services/autorecap/autorecap.go#L462-L465

func handleMessage() {
	may.Invoke(m.botService.UnpinChatMessage(tgbot.NewUnpinChatMessageConfig(chatID, lastPinnedMessage.MessageID)), "failed to unpin chat message", zap.Int64("chat_id", chatID), zap.Int("message_id", lastPinnedMessage.MessageID))
	may.Invoke(m.chathistories.UpdatePinnedMessage(lastPinnedMessage.ChatID, lastPinnedMessage.MessageID, false), "failed to save one telegram sent message", zap.Int64("chat_id", lastPinnedMessage.ChatID), zap.Int("message_id", lastPinnedMessage.MessageID))
	may.Invoke(m.botService.PinChatMessage(tgbot.NewPinChatMessageConfig(chatID, sentMsg.MessageID)), "failed to pin chat message", zap.Int64("chat_id", chatID), zap.Int("message_id", sentMsg.MessageID))
	may.Invoke(m.chathistories.SaveOneTelegramSentMessage(&sentMsg, true), "failed to save one telegram sent message")
}

Full Changelog: v1.3.0...v1.4.0

v1.3.0

19 Feb 08:53
6f7a7b2
Compare
Choose a tag to compare

Full Changelog: v1.2.1...v1.3.0

v1.2.1

30 Aug 10:18
5a49731
Compare
Choose a tag to compare

v1.1.2

16 Aug 03:43
922e923
Compare
Choose a tag to compare
  • Updated to go1.21

Full Changelog: v1.1.1...v1.1.2

v1.1.1

18 May 05:02
Compare
Choose a tag to compare

Changes

  • Added more testable examples
  • Complete README.md docs

Full Changelog: v1.1.0...v1.1.1

v1.1.0

17 May 17:02
Compare
Choose a tag to compare

Breaking change

  • removed package level CollectAsError(...), CollectAsErrors(...), HandleErrors(...), HandleErrorsWithReturns(...) functions, now these functions has become the member methods of MayInvoker*.

Full Changelog: v1.0.0...v1.1.0

v1.0.0

17 May 13:55
Compare
Choose a tag to compare

Published