huluntuntao32 downloadsRun, format, and share Golang code snippets using the Go Playground API.
Run, format, and share Golang code snippets using the Go Playground API.
在 Obsidian 中直接运行和分享 Go 代码。
Search for "Go Playground" in Settings → Community plugins → Browse.
在 设置 → 社区插件 → 浏览 中搜索 "Go Playground"。
Download main.js, manifest.json, and styles.css from the latest release.
从最新 release 下载 main.js、manifest.json 和 styles.css。
Copy them to <vault>/.obsidian/plugins/go-playground/.
复制到 <vault>/.obsidian/plugins/go-playground/。
Reload Obsidian and enable the plugin in Settings → Community plugins.
重新加载 Obsidian 并在 设置 → 社区插件 中启用。
Create a Go code block in Markdown and click the Run button to view output.
在 Markdown 中创建 Go 代码块,点击 运行 按钮查看输出。
Example / 示例:
package main
import "fmt"
func main() {
fmt.Println("Hello, Obsidian!")
}

Right-click in editor and select Insert Go Snippet, then paste a Go Playground URL (e.g., https://play.golang.com/p/xxx) or snippet ID to import code.
右键菜单选择 插入 Go 代码段,粘贴 Go Playground 链接(如 https://play.golang.com/p/xxx)或 snippet ID 导入代码。

Settings → Go Playground / 设置 → Go Playground
https://play.golang.org / API 地址,默认 https://play.golang.orgBy default, this plugin executes, formats, or shares code via https://play.golang.org. By using this plugin, you agree to the terms of service of Go Playground.
Network requests are only sent when you click run or insert buttons. Code is executed via the configured API. No vault data is collected.
在默认设置下,本插件通过 https://play.golang.org 运行、格式化或分享代码。使用前请确认您同意 Go Playground 的服务条款。
仅在点击运行或插入按钮时发送网络请求。代码通过配置的 API 执行,不会收集或上传笔记内容。
npm install
# Development mode with watch / 开发模式(自动重新编译)
npm run dev
# Production build / 生产构建
npm run build
main.js, manifest.json, and styles.css to a test vault's plugin folderIssues and pull requests are welcome.
欢迎提交 Issue 和 Pull Request。
MIT