All skills
gogf avatar

/goframe-v2

@911705d
by GoFramegogf/skills81 stars
3

GoFrame v2 development skill. Use only when the target Go project uses or is explicitly adopting GoFrame v2: the nearest go.mod requires github.com/gogf/gf/v2, existing Go files import github.com/gogf/gf/v2 or any github.com/gogf/gf/v2/... component package, or the user asks to scaffold, migrate, or build with GoFrame. Trigger for GoFrame-backed Go work such as APIs/controllers/services, middleware, routing/config, ORM/DAO/DO/entity/database operations, gf CLI/codegen, HTTP/gRPC services, and microservice conventions. Do not trigger for generic Go projects without GoFrame evidence, frontend-only work, shell scripts, or unrelated infrastructure tasks.

Use this Skill: https://skilld.dev/gh/gogf/skills/goframe-v2

This session only. Nothing lands on disk.

references核心组件I18N国际化I18N国际化-配置管理.md

作为框架的核心组件之一,传承 goframe 一贯的便捷化设计思想, I18N 国际化组件的配置管理非常简便。

文件格式

gi18n 国际化组件支持框架通用的五种配置文件格式: xml/ini/yaml/toml/json/properties(更详细的文件支持列表具体以配置管理章节为主: 配置管理)。同样的,和配置管理模块一样,框架推荐使用 toml 文件格式。

读取路径

默认情况下 gi18n 会自动查找并读取当前项目源码根目录(或者当前 PWD 运行目录下)下的以下目录:

  • manifest/i18n
  • i18n

默认将查找到的目录作为国际化转译文件存储目录。开发者也可以通过 SetPath 方法自定义 i18n 文件的存储目录路径。

文件存储

在 i18n 目录下可以直接按照国际化名称命名的文件如: en.toml/ ja.toml/ zh-CN.toml;也可以给定国际化名称目录,目录下随意自定义配置文件,如: en/editor.toml/ en/user.toml、 zh-CN/editor.toml/ zh-CN/user.toml。您使用纯文件管理或者增加一级目录管理都是可以的, gi18n 可以智能识别加载。 :::tip 国际化的文件/目录名称都是开发者可自行定义和维护的,该名称主要用于程序中设置和使用。建议按照标准化的国际化地区语言码进行命名,具体请参考WIKI: https://zh.wikipedia.org/wiki/ISO_639-1 ::: 例如,以下的 i18n 目录结构以及文件格式都是支持的。

通过单独的 i18n 文件区分不同的语言

└── i18n
    ├── en.toml
    ├── ja.toml
    ├── ru.toml
    ├── zh-CN.toml
    └── zh-TW.toml

通过不同的目录名称区分不同的语言

└── i18n
    ├── en
    │   ├── hello.toml
    │   └── world.toml
    ├── ja
    │   ├── hello.yaml
    │   └── world.yaml
    ├── ru
    │   ├── hello.ini
    │   └── world.ini
    ├── zh-CN
    │   ├── hello.json
    │   └── world.json
    └── zh-TW
        ├── hello.xml
        └── world.xml

不同语言可以存在不同文件格式

└── i18n
    ├── en.toml
    ├── ja.yaml
    ├── ru.ini
    ├── zh-CN.json
    └── zh-TW.xml

资源管理器

gi18n 默认支持资源管理器(详情请参考章节: 资源管理),默认情况下会从 gres 配置管理器中检索 manifest/i18n 及 i18n 目录,或者开发者设置的 i18n 目录路径。

Source: SKILL.md on GitHub

1 alert16d5 checks · Risk MEDIUM
  • Gen Agent Trust Hub16d

    The skill provides a comprehensive development guide and code examples for the GoFrame v2 framework. While highly informative for Go developers, it contains several examples with hardcoded placeholder secrets, tokens, and specific local file paths to sensitive configuration files (like Kubernetes credentials). These elements are provided for demonstration purposes but represent insecure practices if used in production without modification.

  • Socket16d

    5 alerts: gptSecurity, gptAnomaly

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    227/949 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 911705d. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 months ago.

Steadyupdated 4 months ago
  • Go
  • Database
  • goframe
  • orm
  • http
  • grpc
  • microservices
  • crud
  • scaffolding
  • middleware

README badge

README badge for gogf/skills

Provides instruction and conventions for developing with GoFrame v2, a modular Go framework for building HTTP and gRPC services, microservices, and database operations using its ORM, CLI tooling, and project scaffolding. Use this skill when the target project has GoFrame v2 as a dependency or when the user requests scaffolding, migrations, or service development with GoFrame conventions.

Generated from the current SKILL.md.

When should I use this skill?
Use this skill only when your Go project uses GoFrame v2, indicated by github.com/gogf/gf/v2 in go.mod or imports. Do not use for generic Go projects, frontend work, or infrastructure tasks unrelated to GoFrame.
Should I manually set created_at and updated_at fields?
No. GoFrame automatically writes created_at on insert and updated_at on insert/update/save. Manually setting these fields is redundant and violates project conventions.
What should I use for database operations instead of g.Map?
Always use DO objects from internal/model/do/. DO struct fields are interface{}, unset fields remain nil and are automatically ignored by the ORM.
How does soft delete work in GoFrame?
Call Delete() on the DAO; GoFrame automatically converts it to UPDATE SET deleted_at = NOW(). Queries automatically filter out soft-deleted rows without requiring manual WhereNull conditions.
Where should I implement business logic?
Implement business logic directly in the service/ directory. Do not use the logic/ directory unless explicitly requested.

Generated from the current SKILL.md. These answers refresh after source changes.