I am a newbie in go
and go-swagger
. I am following steps in Simple Server tutorial in goswagger.io.
I am using Ubuntu 18.04
, swagger v0.25.0
and go 1.15.6
.
- Following the same steps, there are a few differences of the files generated. For instance, goswagger.io's has
find_todos_okbody.go
andget_okbody.go
inmodels
but mine does not. Why is that so?
Link to screenshot of my generated files vs Link to screenshot of generated files by swagger.io
- Starting the server as written in the tutorial
go install ./cmd/todo-list-server/
gives me the following error. Can anyone please help with this?
# my_folder/swagger-todo-list/restapi
restapi/configure_todo_list.go:41:8: api.TodosGetHandler undefined (type *operations.TodoListAPI has no field or method TodosGetHandler)
restapi/configure_todo_list.go:42:6: api.TodosGetHandler undefined (type *operations.TodoListAPI has no field or method TodosGetHandler)
- The first step in goswagger.io todo-list is
swagger init spec ...
. Which directory should I run this command in? I ran it in a newly created folder in my home directory. However, from the page, it shows the path to be~/go/src/github.com/go-swagger/go-swagger/examples/tutorials/todo-list
. I am not sure whether I should usego get ...
,git clone ...
or create those folders. Can someone advise me?
Thanks.