



NewRAMStorage(…)
is just something that setups your storage and initial data.. that can probably live with storage/sqlite
. The point is the storage
package does not import the implementations of storage.Storage
It just defines the contract for things that use that interface. Now storage/sqlite
CAN import storage
and not have a circle dep. It kinda works in reverse for import directions. usually you have your root package that imports things from deeper in the directory structures.. but for the case of interfaces it reverses where the deeper can import from parents but parents cannot import from children.
- app < storage
< storage/sqlite
< controller < storage
< storage/sqlite
- sqlite < storage
- storage X storage/sqlite
NewRAMStorage(…)
is just something that setups your storage and initial data.. that can probably live with storage/sqlite
. The point is the storage
package does not import the implementations of storage.Storage
It just defines the contract for things that use that interface. Now storage/sqlite
CAN import storage
and not have a circle dep. It kinda works in reverse for import directions. usually you have your root package that imports things from deeper in the directory structures.. but for the case of interfaces it reverses where the deeper can import from parents but parents cannot import from children.
- app < storage
< storage/sqlite
< controller < storage
< storage/sqlite
- sqlite < storage
- storage X storage/sqlite
storage.Storage
- storage/ defines the
Storage
interface (no tests!) - storage/sqlite for the sqlite implementation tests for sqlite directly
- storage/ram for the ram implementation and tests for RAM directly
- controller/ can now import both storage and the implementation as needed.
So now I am guessing you wanted the RAM test for testing queries against sqlite and have it return some query response?
For that I usually would register a driver for SQL that emulates sqlite. Then it's just a matter of passing the connection string to open the registered driver on setup.
https://github.com/glebarez/go-sqlite?tab=readme-ov-file#connection-string-examples
storage.Storage
- storage/ defines the
Storage
interface (no tests!) - storage/sqlite for the sqlite implementation tests for sqlite directly
- storage/ram for the ram implementation and tests for RAM directly
- controller/ can now import both storage and the implementation as needed.
So now I am guessing you wanted the RAM test for testing queries against sqlite and have it return some query response?
For that I usually would register a driver for SQL that emulates sqlite. Then it's just a matter of passing the connection string to open the registered driver on setup.
https://github.com/glebarez/go-sqlite?tab=readme-ov-file#connection-string-examples
(gesendet aus Thüringen)
¡Feminismo es igualdad!
#8M #DiaInternacionalDeLaMujer #WomenPower ⌘ Read more****



Ein Wochenende auf Achse wird das. 🚞🚐😞

Una opinión pragmática es que hay la libertad de no pagar, pero también esto nos debería llevar a que tenemos la libertad de SÍ reconocer los proyectos que nos dan valor, por medio de un donativo puntual o constante. Adaptarnos al contexto de lo que estamos ofreciendo.
Mi chava trabaja en Asociaciones Civiles (tipo OSALs/ONGs) y es un reto pedir donativos, por lo que es común pedir 'Cuotas de recuperación' pues ayudan a valorar más el servicio, y a que fluya el donativo. Creo que se puede hacer algo así en el código libre, apelando a diferentes motivadores en los usuarios.
* storage/
* storage.go: defines a
Storage
interface* sqlite.go: implements the
Storage
interface* sqlite_test.go: originally had a function to set up a test storage to test the SQLite storage implementation itself:
newRAMStorage(testing.T, $initialData) *Storage
* controller/
* feeds.go: uses a
Storage
* feeds_test.go: here I wanted to reuse the
newRAMStorage(…)
functionI then tried to relocate the
newRAMStorage(…)
into a* teststorage/
* storage.go: moved here as
NewRAMStorage(…)
so that I could just reuse it from both
* storage/
* sqlite_test.go: uses
testutils.NewRAMStorage(…)
* controller/
* feeds_test.go: uses
testutils.NewRamStorage(…)
But that results into an import cycle, because the
teststorage
package imports storage
for storage.Storage
and the storage
package imports testutils
for testutils.NewRAMStorage(…)
in its test. I'm just screwed. For now, I duplicated it as newRAMStorage(…)
in controller/feeds_test.go.I could put
NewRAMStorage(…)
in storage/testutils.go, which could be guarded with //go:build testutils
. With go test -tags testutils …
, in storage/sqlite_test.go could just use NewRAMStorage(…)
directly and similarly in controller/feeds_test.go I could call storage.NewRamStorage(…)
. But I don't know if I would consider this really elegant.The more I think about it, the more appealing it sounds. Because I could then also use other test-related stuff across packages without introducing other dedicated test packages. Build some assertions, converters, types etc. directly into the same package, maybe even make them methods of types.
If I went that route, I might do the opposite with the build tag and make it something like
!prod
instead of testing. Only when building the final binary, I would have to specify the tag to exclude all the non-prod stuff. Hmmm.*
* storage/
* storage.go: defines a
Storage
interface* sqlite.go: implements the
Storage
interface* sqlite_test.go: originally had a function to set up a test storage to test the SQLite storage implementation itself:
newRAMStorage(testing.T, $initialData) *Storage
* controller/
* feeds.go: uses a
Storage
* feeds_test.go: here I wanted to reuse the
newRAMStorage(…)
functionI then tried to relocate the
newRAMStorage(…)
into a* teststorage/
* storage.go: moved here as
NewRAMStorage(…)
so that I could just reuse it from both
* storage/
* sqlite_test.go: uses
testutils.NewRAMStorage(…)
* controller/
* feeds_test.go: uses
testutils.NewRamStorage(…)
But that results into an import cycle, because the
teststorage
package imports storage
for storage.Storage
and the storage
package imports testutils
for testutils.NewRAMStorage(…)
in its test. I'm just screwed. For now, I duplicated it as newRAMStorage(…)
in controller/feeds_test.go.I could put
NewRAMStorage(…)
in storage/testutils.go, which could be guarded with //go:build testutils
. With go test -tags testutils …
, in storage/sqlite_test.go could just use NewRAMStorage(…)
directly and similarly in controller/feeds_test.go I could call storage.NewRamStorage(…)
. But I don't know if I would consider this really elegant.The more I think about it, the more appealing it sounds. Because I could then also use other test-related stuff across packages without introducing other dedicated test packages. Build some assertions, converters, types etc. directly into the same package, maybe even make them methods of types.
If I went that route, I might do the opposite with the build tag and make it something like
!prod
*
Also brilliantly put: "[...] By the way, the image of feminists being complainers is not something that appeared out of thin air, but was constructed by people opposing feminism [...]"
https://www.felienne.com/archives/8470
UPDATE: Looks like posting on feminism attracts some ugly replies and I have blocked 3 users already... that's useful in a sense.
https://www.youtube.com/watch?v=CghK8iVUHBs

La mayoría de los mantenedores no reciben ningún soporte económico. Solo unos pocos proyectos logran sostenibilidad financiera a través de patrocinios, mientras que la mayoría de los desarrolladores terminan con un segundo empleo no remunerado.
Sin un cambio en la forma en que se valora y apoya los proyectos Opensource, y no solo hablo de las grandes empresas multimillonarias. Sería una perdida para todos si acabaremos con un ecosistema de software archivado y abandonado.
Ahora te paso la pelota a ti, ¿cuando fue la última vez que apoyaste a un mantenedor de software opensource?
#opensource #software #sostenibilidad
La mayoría de los mantenedores no reciben ningún soporte económico. Solo unos pocos proyectos logran sostenibilidad financiera a través de patrocinios, mientras que la mayoría de los desarrolladores terminan con un segundo empleo no remunerado.
Sin un cambio en la forma en que se valora y apoya los proyectos Opensource, y no solo hablo de las grandes empresas multimillonarias. Sería una perdida para todos si acabaremos con un ecosistema de software archivado y abandonado.
Ahora te paso la pelota a ti, ¿cuando fue la última vez que apoyaste a un mantenedor de software opensource?
#opensource #software #sostenibilidad
"Há poucas semanas, esta nova Comissão (apesar da mesma Presidente Ursula von der Leyen), apresentou o chamado pacote legislativo “omnibus”. [...]
A proposta #Omnibus pretende alterar três pilares fundamentais do Pacto Ecológico Europeu - a Diretiva de Dever de Diligência das Empresas em Sustentabilidade (#CSDDD), a Diretiva de Comunicação de Informações de Sustentabilidade das Empresas (#CSRD) e o Regulamento de Taxonomia. Tal pode comprometer os objetivos climáticos e sociais da União Europeia. O argumento da simplificação regulatória, usado pela Comissão Europeia, vai, na prática, resultar no enfraquecimento de regras fundamentais que garantem transparência empresarial, redução de emissões e proteção dos direitos humanos nas cadeias de fornecimento globais. Além disso, essa revisão legislativa ameaça as empresas que já investiram na transição sustentável, favorecendo aquelas que ainda não se adaptaram às exigências ambientais e sociais.
Quando a Europa deveria ser um farol à escala mundial, num mundo ameaçado por enormes crises ambientais, estamos afinal a retroceder em áreas fundamentais para o futuro."
"Há poucas semanas, esta nova Comissão (apesar da mesma Presidente Ursula von der Leyen), apresentou o chamado pacote legislativo “omnibus”. [...]
A proposta #Omnibus pretende alterar três pilares fundamentais do Pacto Ecológico Europeu - a Diretiva de Dever de Diligência das Empresas em Sustentabilidade (#CSDDD), a Diretiva de Comunicação de Informações de Sustentabilidade das Empresas (#CSRD) e o Regulamento de Taxonomia. Tal pode comprometer os objetivos climáticos e sociais da União Europeia. O argumento da simplificação regulatória, usado pela Comissão Europeia, vai, na prática, resultar no enfraquecimento de regras fundamentais que garantem transparência empresarial, redução de emissões e proteção dos direitos humanos nas cadeias de fornecimento globais. Além disso, essa revisão legislativa ameaça as empresas que já investiram na transição sustentável, favorecendo aquelas que ainda não se adaptaram às exigências ambientais e sociais.
Quando a Europa deveria ser um farol à escala mundial, num mundo ameaçado por enormes crises ambientais, estamos afinal a retroceder em áreas fundamentais para o futuro."
"Gande Carnaval de Verão 1974" é um disco de Carnaval em que as letras foram alteradas para promover a #Tupperware :-P

"Gande Carnaval de Verão 1974" é um disco de Carnaval em que as letras foram alteradas para promover a #Tupperware :-P

the morning is so much better to run. just the getting up part sucks. legs tired from such a quick turn around but felt fine.
#running
the morning is so much better to run. just the getting up part sucks. legs tired from such a quick turn around but felt fine.
#running
the morning is so much better to run. just the getting up part sucks. legs tired from such a quick turn around but felt fine.
#running

late run do to work and life. had my daughters field trip this morning which was fun. definitely going to sleep hard tonight.
#running
late run do to work and life. had my daughters field trip this morning which was fun. definitely going to sleep hard tonight.
#running
late run do to work and life. had my daughters field trip this morning which was fun. definitely going to sleep hard tonight.
#running

Yarn won't display anything. but the parser does add it to the AST in a way that you can parse it out using
twt.Attrs().Get("lang")
https://git.mills.io/yarnsocial/go-lextwt/src/branch/main/ast.go#L1270-L1272
https://git.mills.io/yarnsocial/go-types/src/branch/main/twt.go#L473-L478
Yarn won't display anything. but the parser does add it to the AST in a way that you can parse it out using
twt.Attrs().Get("lang")
https://git.mills.io/yarnsocial/go-lextwt/src/branch/main/ast.go#L1270-L1272
https://git.mills.io/yarnsocial/go-types/src/branch/main/twt.go#L473-L478
#ptpol
#ptpol