F
F
FedorWK2021-11-18 19:39:43
go
FedorWK, 2021-11-18 19:39:43

How to organize methods for data representation conversion in a Go project?

I am writing a project in which it is necessary to perform a lot of manipulations with tables. Several libraries are used, each with its own internal format for presenting tabular data. How and where to organize methods/functions for converting internal data representation formats?
1) Use your own structure and define methods for converting and parsing other formats on it? 2) Or write a set of necessary functions for converting between library formats?

As I see it in Golang
So far, the most competent option seems to be to take the lowest-level implementation (matrices from the gonum / mat mathematical library), embed it in a structure, where in addition to it there will be an array of table headers and define the missing methods for converting on this structure.

Are there better options? How to organize this in the project structure?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
uvelichitel, 2021-11-21
@FedorWK

Little context. The first thing that comes to mind is better:
"1) Use your own structure and define methods on it for converting and parsing other formats"
This will make data processing more convenient, since "it is necessary to perform a lot of manipulations", it will allow you to do semantic and not just syntactic processing. Will give single source of truth. Simplifies debug and support.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question