tkrajina / typescriptify-golang-structs

A Golang struct to TypeScript class/interface converter
Apache License 2.0
505 stars 87 forks source link

imports .: import cycle not allowed / Can`t handle package "." #52

Closed loeffel-io closed 2 years ago

loeffel-io commented 2 years ago

go version go1.17 darwin/amd64

tscriptify -package=. -target=/Users/lucasloffel/js/ranked/ranked-ui/src/model/test.ts ./test.go
Parsing: ./test.go
go run /var/folders/15/n8y3ck4x6nxb93ymt3gtqr_m0000gn/T/3451915346/typescriptify_722417000.go
package command-line-arguments
        imports .
        imports .: import cycle not allowed
../../../../pkg/mod/github.com/tkrajina/typescriptify-golang-structs@v0.1.6/typescriptify/typescriptify.go:12:2: missing go.sum entry for module providing package github.com/tkrajina/go-reflector/reflector (imported by github.com/tkrajina/typescriptify-golang-structs/typescriptify); to add:
        go get github.com/tkrajina/typescriptify-golang-structs/typescriptify@v0.1.6

panic: exit status 1

goroutine 1 [running]:
main.handleErr(...)
        /Users/lucasloffel/go/pkg/mod/github.com/tkrajina/typescriptify-golang-structs@v0.1.6/tscriptify/main.go:172
main.main()
        /Users/lucasloffel/go/pkg/mod/github.com/tkrajina/typescriptify-golang-structs@v0.1.6/tscriptify/main.go:129 +0x9c6
make: *** [ts-ranked-ui-model] Error 2

test.go

package model

type Test struct {
    Name string `json:"peter"`
}
loeffel-io commented 2 years ago

https://github.com/tkrajina/go-reflector/pull/5