Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
wild-workouts-go-ddd-example
Go DDD example application. Complete project to show how to apply DDD, Clean Architecture, and CQRS by practical refactoring.
I actually just opened up issue 18 to do just this as I think it's important. Thanks!
You're right on both of these, and I'm not settled on this at all. Struct initialization and element setting are something I haven't landed on yet for larger structs. Personally, I like the pattern like sendgrid uses for struct initialization (examples here). Using the context of my repo, seems like if they are just initializing a struct, they'd use NewMovie and if they are actually adding logic as part of the struct initialization, they'd use NewMovieInit (e.g. in their repo, NewV3Mail and NewV3MailInit).
I personally have no issues with nesting, as long as the packages don't mix implementation details with the business rules - that's one thing I'd be careful with. If you'd like to compare the approach, here's another example (I'm one of the authors).
Related posts
- How to Send Emails in Go
- Which is most efficient way to read a http response body
- Mailpit – email and SMTP testing tool with API for developers
- Mailpit An email and SMTP testing tool with API
- Microsoft email servers don't support PlainAuth (without modification), but do support LoginAuth. I couldn't find a package to handle it, so I made this one.