mirror of
https://github.com/fengxxc/wechatmp2markdown.git
synced 2026-02-27 01:00:54 +08:00
refactor: update outdated stuff
This commit is contained in:
@@ -41,6 +41,7 @@ markdown和图片文件将保存在 `D:\wechatmp_bak\2022年度总结\` 下
|
||||
将返回一个zip文件
|
||||
|
||||
## 开发
|
||||
go 1.20
|
||||
### 编译
|
||||
#### Linux or Mac 环境
|
||||
```
|
||||
|
||||
@@ -12,8 +12,7 @@ type Header struct {
|
||||
Text string
|
||||
}
|
||||
|
||||
// go不资瓷泛型可真是难受...
|
||||
type Value interface{}
|
||||
type Value any
|
||||
|
||||
type Piece struct {
|
||||
Type PieceType
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"bytes"
|
||||
"encoding/base64"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
@@ -187,7 +186,7 @@ func ParseFromHTMLFile(filepath string, imagePolicy ImagePolicy) Article {
|
||||
panic(err)
|
||||
}
|
||||
defer file.Close()
|
||||
content, err2 := ioutil.ReadAll(file)
|
||||
content, err2 := io.ReadAll(file)
|
||||
if err2 != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -229,7 +228,7 @@ func fetchImgFile(url string) []byte {
|
||||
if res.StatusCode != 200 {
|
||||
log.Fatalf("get Image from url %s error: %d %s", url, res.StatusCode, res.Status)
|
||||
}
|
||||
content, err := ioutil.ReadAll(res.Body)
|
||||
content, err := io.ReadAll(res.Body)
|
||||
if err != nil {
|
||||
log.Fatalf("read image Response error: %s", err.Error())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user