andygeiss/esp32-transpiler

View on GitHub
transpile/handlers/handleSpecs.go

Summary

Maintainability
A
0 mins
Test Coverage
package handlers

import "go/ast"

func handleSpecs(specs []ast.Spec) string {
    code := ""
    for _, spec := range specs {
        switch spec.(type) {
        case *ast.ImportSpec:
            code += handleImportSpec(spec)
        case *ast.ValueSpec:
            code += handleValueSpec(spec) + ";"
        }
    }
    return code
}