Skip to content

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

GoLand LeetCode 刷题插件模板

本仓库提供 GoLand 使用 LeetCode Editor 插件刷 Go 题的推荐配置。

原插件

安装方式

  1. 打开 GoLand:Settings → Plugins → Marketplace
  2. 搜索 LeetCode Editor
  3. 点击 Install,重启 GoLand
  4. 打开 Settings → Tools → LeetCode Plugin:
    • URL:https://leetcode.cn 或 https://leetcode.com
    • Code Type:Go
    • Temp File Path:本地的 Go 项目目录(上层需要有 go.mod)
    • 登录后即可拉取题目

CodeFileName

$!velocityTool.leftPadZeros(${question.frontendQuestionId}, 4)-$!velocityTool.camelCaseName(${question.titleSlug})/$!velocityTool.smallCamelCaseName(${question.titleSlug})

CodeTemplate

package p$!velocityTool.camelCaseName(${question.titleSlug})

${question.code}

// ---------- 本地补全用,不会提交 ----------

type ListNode struct {
Val  int
Next *ListNode
}

type TreeNode struct {
Val   int
Left  *TreeNode
Right *TreeNode
}

type Node struct {
Val       int
Next      *Node
Prev      *Node
Child     *Node
Left      *Node
Right     *Node
Random    *Node
Neighbors []*Node
Children  []*Node
}

使用说明

  • 每题一个目录、一个 package,不会互相串。
  • submit region end 之后的类型只用于本地补全和语法检查,不会被提交。
  • Temp File Path 上层需要先执行 go mod init <模块名> 生成 go.mod。
  • 建议在插件设置中开启 Custom code template,再将上面的 CodeFileName / CodeTemplate 粘贴进去。

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors