Preface
Hello everyone, I am Evan Lin, a Tech Evangelist at LINE Taiwan. I am very happy to be invited by the Golang community to participate in the "Golang Taipei Gathering #54" meetup event and share some Golang development skills and personal development experiences. Here, I would also like to share my experiences from this event, and I hope that through the power of community sharing, Golang can be better understood.
- Community Chatbots Meetup: https://www.meetup.com/golang-taipei-meetup
- This event webpage: Event URL
Golang in LINE MUSIC TW - Wei@LINE Music
Introduction to the main Golang packages used in LINE Music and related experience sharing.
errors x stack x info - Hsueh-Tsung Kuo @Rayark
Slides: https://hackmd.io/@fieliapm/Bk48ziTj8#/
First, the speaker introduced some of the commonly criticized problems of the Go Error system:
- Errors contain too little information
- Not easy to understand errors, unpacking (extracting errors) and packaging
Go 1.13 errors
You can refer to this article Working with Errors in Go 1.13, which allows you to package and unpack Errors through Warp and UnWarp.
- Is there a way to Inspect?
- Use
error.Is()to determine if it's the same, or useerror.As()to determine if it's the same type (type assertion).
Go Error system sucks, you can refer to Rust's error handling and Trait std::error::Error
- https://github.com/pkg/errors is good, but it cannot parse the underlying errors (because it is incompatible with the underlying standard error). Refer to the article Can new Go errors wrapper replace pkg/errors?
Reference Links
- Working with Errors in Go 1.13
- Rust's error handling
- Rust std::error
- Can new Go errors wrapper replace pkg/errors?
Event Summary
Join the "LINE Developer Official Community" official account immediately to receive push notifications of the latest Meetup events or the latest news related to the developer program. ▼
"LINE Developer Official Community" Official Account ID: @line_tw_dev
About the "LINE Developer Community Program"
LINE launched the "LINE Developer Community Program" in Taiwan at the beginning of this year, and will invest long-term manpower and resources to hold developer community gatherings, job fairs, developer conferences, etc., both internally and externally, online and offline, in Taiwan. More than 30 events have already been held. Readers are welcome to continue to check back for the latest updates. For details, please see:


Top comments (0)