Add Docs on how to deal with this breaking change doResponse should return responce in all cases, to prosses things manualy if wanted helper func return http response Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/416 Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2.6 KiB
Migration Guide: v0.12 to v0.13
v0.13.0 introduces a number of breaking changes, throu it should not be hard to migrate.
Just follow this guid and if issues still ocure ask for help on discord or
feel free to create an issue.
- EditMilestoneOption use StateType (#350)
- RepoSearch Options Struct was rewritten (#346)
- Variable Renames (#386)
- Change Type of Permission Field (#408)
- All Function return http responce (#416)
EditMilestoneOption use StateType
Instead of a raw string StateType is now used for State too.
just replace old strings with new enum.
Pulls:
RepoSearch Options Struct was rewritten
Since the API itself is ugly and there was no nameconvention whats o ever.
You easely can pass the wrong options and dont get the result you want.
Now it is rewritten and translated for the API.
The easyest way to migrate is to look at who this function is used and rewritten that code block.
If there is a special edgecase you have you can pass a RawQuery
to the API endpoint.
Pulls:
Variable Renames
Some names of strcut options have been renamed to describe there function/usecase more precisely.
if you use CreateOrgOption
somewhere just rename UserName
to Name
.
Pulls:
Change Type of Permission Field
The following functions are affected: ListOrgTeams, ListMyTeams, GetTeam, CreateTeam, EditTeam and AddCollaborator
The Permission
field has changed type from string
to AccessMode
,
which represent the raw strings you must use before.
Just replace the string with the AccessMode equivalent.
Pulls:
All Function return http responce
All functions got one new return (Responce
)!
If you just like to migrate, add _,
before the error return.
example:
- user, err := c.GetMyUserInfo()
+ user, _, err := c.GetMyUserInfo()
If you like to check responce if an error ocure, make sure responce is not nil!
If an error ocure before an http request (e.g. gitea is to old), it will be nil.
Pulls: