Hey everyone!! can someone tell me or provide me the resources for handling transactional in go language controller. Like we handle in java springboot with annotation @Transactional.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (1)
Hi there! Firstly you need to use the package
database/sql
(use Go mod)And sadly, unlike java spring, there's not a tag like @Transactional, you need to do it. using any Error handler or using
Panic
. But if you want to use a simple way, just detect an error and then do a.Rollback()
and that's all!