Skip to content

Commit fc95730

Browse files
committed
chore: go 1.19 format
1 parent de46c08 commit fc95730

File tree

30 files changed

+589
-535
lines changed

30 files changed

+589
-535
lines changed

cmd/cleanup/sql.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ Copyright © 2019 NAME HERE <EMAIL ADDRESS>
33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.
55
You may obtain a copy of the License at
6-
http://www.apache.org/licenses/LICENSE-2.0
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
79
Unless required by applicable law or agreed to in writing, software
810
distributed under the License is distributed on an "AS IS" BASIS,
911
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

cmd/migrate/sql.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,

examples/go/selfservice/error/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
// If you use Open Source this would be:
1010
//
11-
//var client = pkg.NewSDKForSelfHosted("http://127.0.0.1:4433")
11+
// var client = pkg.NewSDKForSelfHosted("http://127.0.0.1:4433")
1212
var client = pkg.NewSDK("playground")
1313

1414
func getError() *ory.SelfServiceError {

examples/go/selfservice/login/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
// If you use Open Source this would be:
1212
//
13-
//var client = pkg.NewSDKForSelfHosted("http://127.0.0.1:4433")
13+
// var client = pkg.NewSDKForSelfHosted("http://127.0.0.1:4433")
1414
var client = pkg.NewSDK("playground")
1515

1616
func performLogin() *ory.SuccessfulSelfServiceLoginWithoutBrowser {

examples/go/selfservice/logout/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
// If you use Open Source this would be:
1212
//
13-
//var client = pkg.NewSDKForSelfHosted("http://127.0.0.1:4433")
13+
// var client = pkg.NewSDKForSelfHosted("http://127.0.0.1:4433")
1414
var client = pkg.NewSDK("playground")
1515

1616
func performLogout() {

examples/go/selfservice/recovery/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
// If you use Open Source this would be:
1212
//
13-
//var client = pkg.NewSDKForSelfHosted("http://127.0.0.1:4433")
13+
// var client = pkg.NewSDKForSelfHosted("http://127.0.0.1:4433")
1414
var client = pkg.NewSDK("playground")
1515

1616
func performRecovery(email string) *ory.SelfServiceRecoveryFlow {

examples/go/selfservice/registration/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
// If you use Open Source this would be:
1212
//
13-
//var client = pkg.NewSDKForSelfHosted("http://127.0.0.1:4433")
13+
// var client = pkg.NewSDKForSelfHosted("http://127.0.0.1:4433")
1414
var client = pkg.NewSDK("playground")
1515

1616
func initRegistration() *ory.SuccessfulSelfServiceRegistrationWithoutBrowser {

examples/go/selfservice/settings/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
// If you use Open Source this would be:
1212
//
13-
//var client = pkg.NewSDKForSelfHosted("http://127.0.0.1:4433")
13+
// var client = pkg.NewSDKForSelfHosted("http://127.0.0.1:4433")
1414
var client = pkg.NewSDK("playground")
1515

1616
var ctx = context.Background()

examples/go/selfservice/verification/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
// If you use Open Source this would be:
1212
//
13-
//var client = pkg.NewSDKForSelfHosted("http://127.0.0.1:4433")
13+
// var client = pkg.NewSDKForSelfHosted("http://127.0.0.1:4433")
1414
var client = pkg.NewSDK("playground")
1515

1616
func performVerification(email string) *ory.SelfServiceVerificationFlow {

examples/go/session/tosession/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
// If you use Open Source this would be:
1010
//
11-
//var client = pkg.NewSDKForSelfHosted("http://127.0.0.1:4433")
11+
// var client = pkg.NewSDKForSelfHosted("http://127.0.0.1:4433")
1212
var client = pkg.NewSDK("playground")
1313

1414
func toSession() *ory.Session {

identity/handler.go

+71-71
Original file line numberDiff line numberDiff line change
@@ -104,23 +104,23 @@ type adminListIdentities struct {
104104

105105
// swagger:route GET /admin/identities v0alpha2 adminListIdentities
106106
//
107-
// List Identities
107+
// # List Identities
108108
//
109109
// Lists all identities. Does not support search at the moment.
110110
//
111111
// Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
112112
//
113-
// Produces:
114-
// - application/json
113+
// Produces:
114+
// - application/json
115115
//
116-
// Schemes: http, https
116+
// Schemes: http, https
117117
//
118-
// Security:
119-
// oryAccessToken:
118+
// Security:
119+
// oryAccessToken:
120120
//
121-
// Responses:
122-
// 200: identityList
123-
// 500: jsonError
121+
// Responses:
122+
// 200: identityList
123+
// 500: jsonError
124124
func (h *Handler) list(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
125125
page, itemsPerPage := x.ParsePagination(r)
126126
is, err := h.r.IdentityPool().ListIdentities(r.Context(), page, itemsPerPage)
@@ -160,25 +160,25 @@ type adminGetIdentity struct {
160160

161161
// swagger:route GET /admin/identities/{id} v0alpha2 adminGetIdentity
162162
//
163-
// Get an Identity
163+
// # Get an Identity
164164
//
165165
// Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
166166
//
167-
// Consumes:
168-
// - application/json
167+
// Consumes:
168+
// - application/json
169169
//
170-
// Produces:
171-
// - application/json
170+
// Produces:
171+
// - application/json
172172
//
173-
// Schemes: http, https
173+
// Schemes: http, https
174174
//
175-
// Security:
176-
// oryAccessToken:
175+
// Security:
176+
// oryAccessToken:
177177
//
178-
// Responses:
179-
// 200: identity
180-
// 404: jsonError
181-
// 500: jsonError
178+
// Responses:
179+
// 200: identity
180+
// 404: jsonError
181+
// 500: jsonError
182182
func (h *Handler) get(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
183183
i, err := h.r.PrivilegedIdentityPool().GetIdentityConfidential(r.Context(), x.ParseUUID(ps.ByName("id")))
184184
if err != nil {
@@ -309,26 +309,26 @@ type AdminCreateIdentityImportCredentialsOidcProvider struct {
309309

310310
// swagger:route POST /admin/identities v0alpha2 adminCreateIdentity
311311
//
312-
// Create an Identity
312+
// # Create an Identity
313313
//
314314
// This endpoint creates an identity. Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
315315
//
316-
// Consumes:
317-
// - application/json
316+
// Consumes:
317+
// - application/json
318318
//
319-
// Produces:
320-
// - application/json
319+
// Produces:
320+
// - application/json
321321
//
322-
// Schemes: http, https
322+
// Schemes: http, https
323323
//
324-
// Security:
325-
// oryAccessToken:
324+
// Security:
325+
// oryAccessToken:
326326
//
327-
// Responses:
328-
// 201: identity
329-
// 400: jsonError
330-
// 409: jsonError
331-
// 500: jsonError
327+
// Responses:
328+
// 201: identity
329+
// 400: jsonError
330+
// 409: jsonError
331+
// 500: jsonError
332332
func (h *Handler) create(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
333333
var cr AdminCreateIdentityBody
334334
if err := jsonx.NewStrictDecoder(r.Body).Decode(&cr); err != nil {
@@ -426,29 +426,29 @@ type AdminUpdateIdentityBody struct {
426426

427427
// swagger:route PUT /admin/identities/{id} v0alpha2 adminUpdateIdentity
428428
//
429-
// Update an Identity
429+
// # Update an Identity
430430
//
431431
// This endpoint updates an identity. The full identity payload (except credentials) is expected. This endpoint does not support patching.
432432
//
433433
// Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
434434
//
435-
// Consumes:
436-
// - application/json
435+
// Consumes:
436+
// - application/json
437437
//
438-
// Produces:
439-
// - application/json
438+
// Produces:
439+
// - application/json
440440
//
441-
// Schemes: http, https
441+
// Schemes: http, https
442442
//
443-
// Security:
444-
// oryAccessToken:
443+
// Security:
444+
// oryAccessToken:
445445
//
446-
// Responses:
447-
// 200: identity
448-
// 400: jsonError
449-
// 404: jsonError
450-
// 409: jsonError
451-
// 500: jsonError
446+
// Responses:
447+
// 200: identity
448+
// 400: jsonError
449+
// 404: jsonError
450+
// 409: jsonError
451+
// 500: jsonError
452452
func (h *Handler) update(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
453453
var ur AdminUpdateIdentityBody
454454
if err := h.dx.Decode(r, &ur,
@@ -516,26 +516,26 @@ type adminDeleteIdentity struct {
516516

517517
// swagger:route DELETE /admin/identities/{id} v0alpha2 adminDeleteIdentity
518518
//
519-
// Delete an Identity
519+
// # Delete an Identity
520520
//
521521
// Calling this endpoint irrecoverably and permanently deletes the identity given its ID. This action can not be undone.
522522
// This endpoint returns 204 when the identity was deleted or when the identity was not found, in which case it is
523523
// assumed that is has been deleted already.
524524
//
525525
// Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
526526
//
527-
// Produces:
528-
// - application/json
527+
// Produces:
528+
// - application/json
529529
//
530-
// Schemes: http, https
530+
// Schemes: http, https
531531
//
532-
// Security:
533-
// oryAccessToken:
532+
// Security:
533+
// oryAccessToken:
534534
//
535-
// Responses:
536-
// 204: emptyResponse
537-
// 404: jsonError
538-
// 500: jsonError
535+
// Responses:
536+
// 204: emptyResponse
537+
// 404: jsonError
538+
// 500: jsonError
539539
func (h *Handler) delete(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
540540
if err := h.r.IdentityPool().(PrivilegedPool).DeleteIdentity(r.Context(), x.ParseUUID(ps.ByName("id"))); err != nil {
541541
h.r.Writer().WriteError(w, r, err)
@@ -566,23 +566,23 @@ type adminPatchIdentity struct {
566566
//
567567
// Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
568568
//
569-
// Consumes:
570-
// - application/json
569+
// Consumes:
570+
// - application/json
571571
//
572-
// Produces:
573-
// - application/json
572+
// Produces:
573+
// - application/json
574574
//
575-
// Schemes: http, https
575+
// Schemes: http, https
576576
//
577-
// Security:
578-
// oryAccessToken:
577+
// Security:
578+
// oryAccessToken:
579579
//
580-
// Responses:
581-
// 200: identity
582-
// 400: jsonError
583-
// 404: jsonError
584-
// 409: jsonError
585-
// 500: jsonError
580+
// Responses:
581+
// 200: identity
582+
// 400: jsonError
583+
// 404: jsonError
584+
// 409: jsonError
585+
// 500: jsonError
586586
func (h *Handler) patch(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
587587
requestBody, err := io.ReadAll(r.Body)
588588
if err != nil {

schema/handler.go

+13-13
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ type getIdentitySchema struct {
7979
//
8080
// Get a JSON Schema
8181
//
82-
// Produces:
83-
// - application/json
82+
// Produces:
83+
// - application/json
8484
//
85-
// Schemes: http, https
85+
// Schemes: http, https
8686
//
87-
// Responses:
88-
// 200: identitySchema
89-
// 404: jsonError
90-
// 500: jsonError
87+
// Responses:
88+
// 200: identitySchema
89+
// 404: jsonError
90+
// 500: jsonError
9191
func (h *Handler) getIdentitySchema(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
9292
ss, err := h.r.IdentityTraitsSchemas(r.Context())
9393
if err != nil {
@@ -147,14 +147,14 @@ type listIdentitySchemas struct {
147147
//
148148
// Get all Identity Schemas
149149
//
150-
// Produces:
151-
// - application/json
150+
// Produces:
151+
// - application/json
152152
//
153-
// Schemes: http, https
153+
// Schemes: http, https
154154
//
155-
// Responses:
156-
// 200: identitySchemas
157-
// 500: jsonError
155+
// Responses:
156+
// 200: identitySchemas
157+
// 500: jsonError
158158
func (h *Handler) getAll(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
159159
page, itemsPerPage := x.ParsePagination(r)
160160

selfservice/errorx/handler.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ type getSelfServiceError struct {
6464

6565
// swagger:route GET /self-service/errors v0alpha2 getSelfServiceError
6666
//
67-
// Get Self-Service Errors
67+
// # Get Self-Service Errors
6868
//
6969
// This endpoint returns the error associated with a user-facing self service errors.
7070
//
@@ -74,16 +74,16 @@ type getSelfServiceError struct {
7474
//
7575
// More information can be found at [Ory Kratos User User Facing Error Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-facing-errors).
7676
//
77-
// Produces:
78-
// - application/json
77+
// Produces:
78+
// - application/json
7979
//
80-
// Schemes: http, https
80+
// Schemes: http, https
8181
//
82-
// Responses:
83-
// 200: selfServiceError
84-
// 403: jsonError
85-
// 404: jsonError
86-
// 500: jsonError
82+
// Responses:
83+
// 200: selfServiceError
84+
// 403: jsonError
85+
// 404: jsonError
86+
// 500: jsonError
8787
func (h *Handler) publicFetchError(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
8888
if err := h.fetchError(w, r); err != nil {
8989
h.r.Writer().WriteError(w, r, err)

0 commit comments

Comments
 (0)