Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Golang port nested struct #8

Open
DrTon opened this issue Aug 6, 2020 · 3 comments
Open

Golang port nested struct #8

DrTon opened this issue Aug 6, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@DrTon
Copy link
Member

DrTon commented Aug 6, 2020

Add support for nested structs in golang port.

@DrTon DrTon added the enhancement New feature or request label Aug 6, 2020
@Zemledelec
Copy link
Collaborator

Zemledelec commented Jan 7, 2021

Сделал в js поддержку вложенных структур. Для сгенерированного json со структурами (сообщениями), мне достаточно, чтобы было примерно так:

        "MyYZ": {
            id: 1,
            fields: [
                { "name": "y", "type": "Int8" },
                { "name": "z", "type": "Int16" },
                { "name": "s", "type": "String[]" },
            ]
        },
        "Coords": {
            "id": 2,
            "fields": [
                { "name": "x", "type": "Int16" },
                { "name": "yz", "type": "MyYZ" },
            ]
        },
        "Param": {
            "id": 3,
            "fields": [
                { "name": "coords", "type": "Coords[]" },
                { "name": "xxx", "type": "Uint8" }
            ]
        }
    };

т.е. должен быть соблюден порядок объявления структур

P.S. в примере используется объявление динамических массивов, но можно и без них

@DrTon
Copy link
Member Author

DrTon commented Jan 7, 2021

А причем тут Go? Это ты про JS. А JS для начала неплохо бы добавить в этот репозиторий, попробуешь? https://github.com/microavia/messgen/tree/master/port

@Zemledelec
Copy link
Collaborator

Zemledelec commented Jan 11, 2021

Я думал golang и go это одно и тоже. Конечно js надо сюда внести.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants