Skip to content

Commit 057f296

Browse files
[feat] close #4
1 parent 9c52b1c commit 057f296

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
repos:
22
- repo: https://github.com/thlorenz/doctoc
3-
rev: v1.4.0
3+
rev: v2.2.0
44
hooks:
55
- id: doctoc
66
exclude: ^vendor/
7-
- repo: git://github.com/dnephin/pre-commit-golang
8-
rev: master
7+
- repo: https://github.com/dnephin/pre-commit-golang
8+
rev: v0.5.0
99
hooks:
1010
- id: go-fmt
1111
exclude: ^vendor/
1212
- id: go-imports
1313
exclude: ^vendor/
1414
- repo: https://github.com/Lucas-C/pre-commit-hooks
15-
rev: v1.1.10
15+
rev: v1.2.0
1616
hooks:
1717
- id: insert-license
1818
exclude: ^vendor/

main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,12 @@ func main() {
8080

8181
msgTemplate := `每日一题(%s)
8282
Title: %s
83+
Difficulty: %s
8384
Tags: %s
8485
Link: %s
8586
LinkCN: %s`
8687
date := today.Date
88+
difficulty := today.Question.Difficulty
8789
title := fmt.Sprintf("%s(%s)", today.Question.TitleCn, today.Question.Title)
8890
tags := make([]string, 0)
8991
for _, tag := range today.Question.TopicTags {
@@ -93,7 +95,7 @@ LinkCN: %s`
9395
link := fmt.Sprintf("%s/problems/%s", api.Leetcode, today.Question.TitleSlug)
9496
linkCn := fmt.Sprintf("%s/problems/%s", api.LeetcodeCn, today.Question.TitleSlug)
9597

96-
content := fmt.Sprintf(msgTemplate, date, title, tagsValue, link, linkCn)
98+
content := fmt.Sprintf(msgTemplate, date, title, difficulty, tagsValue, link, linkCn)
9799

98100
log.Println(content)
99101

0 commit comments

Comments
 (0)