dgryski / tinygo-test-corpus

run a test corpus against tinygo
MIT License
4 stars 1 forks source link

Rewrite in Go #6

Closed dgryski closed 2 years ago

dgryski commented 2 years ago

This started out as a bash for loop, which then became a bash script, and then finally a python script. Move this fully to Go. While we're at it, move the repo config out of the main binary.

soypat commented 2 years ago

I can maybe take a look at this over the weekend

soypat commented 2 years ago

Ok so I got this so far for rewriting the repos structure for all ye whippersnappers out there

type T struct {
    Repo    string
    Tags    string
    Subdirs []string
}

And can be generated via


print("var repos = []T{\n")
for repo in repos:
    print(f'{{\n\tRepo:"{repo["repo"]}",')
    if 'tags' in repo:
        print(f'\tTags:"{repo["tags"]}",')
    if 'subdirs' in repo:
        print('\tSubdirs: []string{')
        for subdir in repo['subdirs']:
            print(f'\t\t"{subdir}",')
        print("},")
    print("},")
print("}")