Skip to content

Commit 058a7e2

Browse files
fiixng formatting in docs (#3016)
1 parent 5ca7a97 commit 058a7e2

File tree

2 files changed

+40
-39
lines changed

2 files changed

+40
-39
lines changed

docs/references/gofrcli/page.md

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The CLI can be run directly from the terminal after installation. Here’s the g
4343

4444
## 1. ***`init`***
4545

46-
The init command initializes a new GoFr project. It sets up the foundational structure for the project and generates a basic "Hello World!" program as a starting point. This allows developers to quickly dive into building their application with a ready-made structure.
46+
The init command initializes a new GoFr project. It sets up the foundational structure for the project and generates a basic "Hello World!" program as a starting point. This allows developers to quickly dive into building their application with a ready-made structure.
4747

4848
### Command Usage
4949
```bash
@@ -53,8 +53,8 @@ The CLI can be run directly from the terminal after installation. Here’s the g
5353

5454
## 2. ***`migrate create`***
5555

56-
The migrate create command generates a migration template file with pre-defined structure in your migrations directory.
57-
This boilerplate code helps you maintain consistent patterns when writing database schema modifications across your project.
56+
The migrate create command generates a migration template file with pre-defined structure in your migrations directory.
57+
This boilerplate code helps you maintain consistent patterns when writing database schema modifications across your project.
5858

5959

6060
### Command Usage
@@ -74,16 +74,16 @@ This command generates a migration directory which has the below files:
7474
package migrations
7575

7676
import (
77-
"gofr.dev/pkg/gofr/migration"
77+
"gofr.dev/pkg/gofr/migration"
7878
)
7979

8080
func create_employee_table() migration.Migrate {
81-
return migration.Migrate{
82-
UP: func(d migration.Datasource) error {
83-
// write your migrations here
84-
return nil
85-
},
86-
}
81+
return migration.Migrate{
82+
UP: func(d migration.Datasource) error {
83+
// write your migrations here
84+
return nil
85+
},
86+
}
8787
}
8888
```
8989
2. An auto-generated all.go file that maintains a registry of all migrations:
@@ -92,27 +92,27 @@ func create_employee_table() migration.Migrate {
9292
package migrations
9393

9494
import (
95-
"gofr.dev/pkg/gofr/migration"
95+
"gofr.dev/pkg/gofr/migration"
9696
)
9797

9898
func All() map[int64]migration.Migrate {
99-
return map[int64]migration.Migrate {
100-
20250127152047: create_employee_table(),
101-
}
99+
return map[int64]migration.Migrate {
100+
20250127152047: create_employee_table(),
101+
}
102102
}
103103
```
104104

105-
> **💡 Best Practice:** Learn about [organizing migrations by feature](../../docs/advanced-guide/handling-data-migrations#organizing-migrations-by-feature) to avoid creating one migration per table or operation.
105+
> **💡 Best Practice:** Learn about [organizing migrations by feature](../../advanced-guide/handling-data-migrations#organizing-migrations-by-feature) to avoid creating one migration per table or operation.
106106
107-
For detailed instructions on handling database migrations, see the [handling-data-migrations documentation](../../docs/advanced-guide/handling-data-migrations)
107+
For detailed instructions on handling database migrations, see the [handling-data-migrations documentation](../../advanced-guide/handling-data-migrations)
108108
For more examples, see the [using-migrations](https://github.com/gofr-dev/gofr/tree/main/examples/using-migrations)
109109
---
110110

111111
## 3. ***`wrap grpc`***
112112

113-
* The gofr wrap grpc command streamlines gRPC integration in a GoFr project by generating GoFr's context-aware structures.
114-
* It simplifies setting up gRPC handlers with minimal steps, and accessing datasources, adding tracing as well as custom metrics. Based on the proto file it creates the handler/client with GoFr's context.
115-
For detailed instructions on using grpc with GoFr see the [gRPC documentation](../../advanced-guide/grpc/page.md)
113+
* The gofr wrap grpc command streamlines gRPC integration in a GoFr project by generating GoFr's context-aware structures.
114+
* It simplifies setting up gRPC handlers with minimal steps, and accessing datasources, adding tracing as well as custom metrics. Based on the proto file it creates the handler/client with GoFr's context.
115+
For detailed instructions on using grpc with GoFr see the [gRPC documentation](../../advanced-guide/grpc)
116116

117117
### Command Usage
118118
**gRPC Server**
@@ -314,7 +314,7 @@ gofr store generate
314314
```
315315

316316
This generates:
317-
```
317+
```text
318318
stores/
319319
├── store.yaml # Central Configuration
320320
├── all.go # Store registry factory (auto-generated)
@@ -383,7 +383,7 @@ models:
383383
```
384384
385385
**Generated structure:**
386-
```
386+
```text
387387
stores/
388388
├── all.go
389389
├── user/
@@ -399,9 +399,9 @@ stores/
399399
**Using the registry with multiple stores:**
400400
```go
401401
import (
402-
"your-project/stores"
403-
"your-project/stores/user"
404-
"your-project/stores/product"
402+
"your-project/stores"
403+
"your-project/stores/user"
404+
"your-project/stores/product"
405405
)
406406

407407
// stores.GetStore returns a factory-created instance
@@ -478,13 +478,13 @@ models:
478478
This generates:
479479
```go
480480
type User struct {
481-
ID int64 `db:"id" json:"id"`
482-
Name string `db:"name" json:"name"`
483-
CreatedAt time.Time `db:"created_at" json:"created_at"`
481+
ID int64 `db:"id" json:"id"`
482+
Name string `db:"name" json:"name"`
483+
CreatedAt time.Time `db:"created_at" json:"created_at"`
484484
}
485485

486486
func (User) TableName() string {
487-
return "user"
487+
return "user"
488488
}
489489
```
490490

@@ -512,8 +512,8 @@ package user
512512
import "gofr.dev/pkg/gofr"
513513
514514
type UserStore interface {
515-
GetUserByID(ctx *gofr.Context, id int64) (User, error)
516-
GetAllUsers(ctx *gofr.Context) ([]User, error)
515+
GetUserByID(ctx *gofr.Context, id int64) (User, error)
516+
GetAllUsers(ctx *gofr.Context) ([]User, error)
517517
}
518518
```
519519

@@ -526,19 +526,19 @@ package user
526526
type userStore struct{}
527527
528528
func NewUserStore() UserStore {
529-
return &userStore{}
529+
return &userStore{}
530530
}
531531
532532
func (s *userStore) GetUserByID(ctx *gofr.Context, id int64) (User, error) {
533-
// TODO: Implement using ctx.SQL()
534-
var result User
535-
// err := ctx.SQL().QueryRowContext(ctx, sql, id).Scan(&result.ID, ...)
536-
return result, nil
533+
// TODO: Implement using ctx.SQL()
534+
var result User
535+
// err := ctx.SQL().QueryRowContext(ctx, sql, id).Scan(&result.ID, ...)
536+
return result, nil
537537
}
538538
539539
func (s *userStore) GetAllUsers(ctx *gofr.Context) ([]User, error) {
540-
// TODO: Implement using ctx.SQL()
541-
return []User{}, nil
540+
// TODO: Implement using ctx.SQL()
541+
return []User{}, nil
542542
}
543543
```
544544

examples/http-server/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ func TraceHandler(c *gofr.Context) (any, error) {
5959
defer c.Trace("traceHandler").End()
6060

6161
span2 := c.Trace("some-sample-work")
62-
<-time.After(time.Millisecond * 1) //nolint:wsl // Waiting for 1ms to simulate workload
62+
// Waiting for 1ms to simulate workload
63+
<-time.After(time.Millisecond * 1) //nolint:wsl
6364
defer span2.End()
6465

6566
// Ping redis 5 times concurrently and wait.
@@ -75,7 +76,7 @@ func TraceHandler(c *gofr.Context) (any, error) {
7576
}
7677
wg.Wait()
7778

78-
//Call to Another service
79+
// Call to Another service
7980
resp, err := c.GetHTTPService("anotherService").Get(c, "redis", nil)
8081
if err != nil {
8182
return nil, err

0 commit comments

Comments
 (0)