you might be familiar with. but since go is about writing a effective code i want to know the which method is more efficient
importing library in multiple go files like:
import log "github.com/sirupsen/logrus"
or making a function an initializing it and use it across multiple packages and files
or is it another better way for doing this? is there any good exporting method rather than these?
Стикер
im on debuging i will remove it after im in production but assume logrus as just a library😁
you don't need structured logging for debugging, that's what print and package fmt can do structured logging is for production logging actually to write JSON logs
it actually behave as same fmt package and you are write its used for making logs for your application and storing the logs the way you code to, but what i mean is imagine you have a library which you use some method of it and you need to use these method over and over again across multiple files, what should you do in this case? make a initial function or ...?
Обсуждают сегодня