Skip to content

Commit b4cd102

Browse files
authored
Fix doc for 1.19 backend guideline (#24942)
Port the file change in https://github.com/go-gitea/gitea/pull/24925/files from `main` to `v1.19` to fix docs
1 parent d1af0a3 commit b4cd102

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

docs/content/doc/contributing/guidelines-backend.en-us.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ To maintain understandable code and avoid circular dependencies it is important
3535
- `cmd`: All Gitea actual sub commands includes web, doctor, serv, hooks, admin and etc. `web` will start the web service. `serv` and `hooks` will be invoked by Git or OpenSSH. Other sub commands could help to maintain Gitea.
3636
- `tests`: Common test utility functions
3737
- `tests/integration`: Integration tests, to test back-end regressions
38-
- `tests/e2e`: E2e tests, to test test front-end <> back-end compatibility and visual regressions.
38+
- `tests/e2e`: E2e tests, to test front-end and back-end compatibility and visual regressions.
3939
- `models`: Contains the data structures used by xorm to construct database tables. It also contains functions to query and update the database. Dependencies to other Gitea code should be avoided. You can make exceptions in cases such as logging.
4040
- `models/db`: Basic database operations. All other `models/xxx` packages should depend on this package. The `GetEngine` function should only be invoked from `models/`.
4141
- `models/fixtures`: Sample data used in unit tests and integration tests. One `yml` file means one table which will be loaded into database when beginning the tests.
@@ -70,7 +70,6 @@ So services must be allowed to create a database transaction. Here is some examp
7070
// services/repository/repository.go
7171
func CreateXXXX() error {
7272
return db.WithTx(func(ctx context.Context) error {
73-
e := db.GetEngine(ctx)
7473
// do something, if err is returned, it will rollback automatically
7574
if err := issues.UpdateIssue(ctx, repoID); err != nil {
7675
// ...

0 commit comments

Comments
 (0)