Closed mrtsbt closed 5 years ago
@ayvan @mrtsbt thank you for your work on this!
@mrtsbt everything looks good. Would you be willing to provide some example code that demonstrates the ability to use gofpdi concurrently?
@phpdave11 I checked in an example that demonstrates the use of an Importer and a test for concurrent use of Importers, based on some local code I used to check for data races. Is that what you had in mind?
Nice work, @mrtsbt! Ready to merge after two small nits are addressed:
$ go vet -all
# github.com/jung-kurt/gofpdf/contrib/gofpdi
./gofpdi_test.go:12:1: ExampleGofpdiImporter refers to unknown identifier: GofpdiImporter
$ goreportcard-cli -v
...
ineffassign: 50%
gofpdi_test.go
Line 53: warning: ineffectual assignment to tpl (ineffassign)
@jung-kurt Sorry about that. Hopefully the checks pass now? I didn't know about goreportcard-cli till now - though I'd better take a look at it, obviously :) Is the name of the test okay, though?
Great -- all checks pass except for a license. That's something @phpdave11 can place at some point. I assume it is MIT like gofpdi.
goreportcard-cli is pretty nice for catching a lot of little things. However, it gets a little too excited about the number of case statements in a switch block so a lot of very straightforward constructions are called out as too "cyclomatically" complex.
I assume this merge means that #269 can be closed?
Yes #269 can be closed now that this PR has been merged. Thanks!
Yes #269 can be closed now that this PR has been merged. Thanks!
closed!
Proposal to allow multiple independent Importer instances. Notably, this should improve concurrent use of the library.
gofpdi
library in a simple structThis PR is based on an idea by @ayvan - see https://github.com/jung-kurt/gofpdf/pull/269 for comparison - but includes recent additions and does not include a
gofpdiPdf
member in the wrapper struct, thus making it easier to retain backwards compatibility without too much code duplication.@ayvan, @phpdave11 For your information. And please feel free to suggest better approaches or different wordings for the comments.