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

exit status 1. expected 'STRING', found '-' #130

Closed
wilhelmguo opened this issue Dec 30, 2015 · 3 comments
Closed

exit status 1. expected 'STRING', found '-' #130

wilhelmguo opened this issue Dec 30, 2015 · 3 comments

Comments

@wilhelmguo
Copy link

I have imported "github.com/fsouza/go-dockerclient" in my type.go . then exe the comand ' codecgen -o type.generated.go type.go' return exit status 1, console: panic: 15:8: expected 'STRING', found '-' .
That is to say every type.go have imported contain '-' exe codecgen will return error.

@ugorji
Copy link
Owner

ugorji commented Dec 30, 2015

Please I need a reproducer.

Can you add a type.go, and I can try to reproducer and fix

@wilhelmguo
Copy link
Author

package api

import (
"k8s.io/kubernetes/pkg/api/unversioned"
kapi "k8s.io/kubernetes/pkg/api"
godockerclient "github.com/fsouza/go-dockerclient"
)

type NodeList struct {
unversioned.TypeMeta json:",inline"
unversioned.ListMeta json:"metadata,omitempty"
Items []Node json:"items,omitempty"
}

type Node struct {
unversioned.TypeMeta json:",inline"
kapi.ObjectMeta json:"metadata,omitempty"
Spec NodeSpec json:"spec,omitempty"
}

type NodeSpec struct {
IP string json:"ip,omitempty"
Components []Component json:"compnents,omitempty"
}

type Component struct {
Name string json:"name,omitempty"
Version string json:"version,omitempty"
Config godockerclient.Config json:"config,omitempty"
HostConfig godockerclient.HostConfig json:"hostconfig,omitempty"
}

@ugorji
Copy link
Owner

ugorji commented Dec 31, 2015

I just ran this locally, and it worked fine. See generated file: https://gist.github.com/ugorji/19801dc6d42ee1975762

Please update your codecgen and retry.

go get -u github.com/ugorji/go/codec github.com/ugorji/go/codec/codecgen

@ugorji ugorji closed this as completed Dec 31, 2015
tamalsaha added a commit to appscodelabs/gengo-builder that referenced this issue Oct 2, 2017
tamalsaha added a commit to ops-center/searchlight that referenced this issue Oct 2, 2017
tamalsaha added a commit to ops-center/searchlight that referenced this issue Oct 2, 2017
tamalsaha added a commit to stashed/stash that referenced this issue Oct 2, 2017
tamalsaha added a commit to stashed/stash that referenced this issue Oct 2, 2017
tamalsaha added a commit to kubedb/apimachinery that referenced this issue Oct 2, 2017
tamalsaha added a commit to kubedb/apimachinery that referenced this issue Oct 2, 2017
tamalsaha added a commit to stashed/apimachinery that referenced this issue Feb 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants