j178 / leetgo

Best LeetCode friend for geek. :snowboarder:
MIT License
540 stars 32 forks source link

[Bug] 升级 leetgo 后报错:unmarshal config failed: 2 error(s) decoding #201

Closed zwyyy456 closed 1 year ago

zwyyy456 commented 1 year ago

Verify steps

leetgo debug

❯ leetgo debug
× unmarshal config failed: 2 error(s) decoding:

* 'code.cpp.cxxflags' expected type 'string', got unconvertible type '[]interface {}', value: '[-O2 -std=c++17]'
* 'editor.args' expected type 'string', got unconvertible type '[]interface {}', value: '[]'
(base)

Debug log

No response

Description

在执行 brew upgrade leetgo 来将 leetgo 更新到最新之后,leetgo 无法正常使用,执行 leetgo debug 或者 leetgo pick 1143 都会出现如下报错:

× unmarshal config failed: 2 error(s) decoding:

* 'code.cpp.cxxflags' expected type 'string', got unconvertible type '[]interface {}', value: '[-O2 -std=c++17]'
* 'editor.args' expected type 'string', got unconvertible type '[]interface {}', value: '[]'

执行 leetgo -v 输出如下:

leetgo version 1.3.1
commit: 92f1dd0a70c124d5506b95f8690e302180bff3f2
built at: 2023-06-14T13:25:11Z
goos: darwin
goarch: arm64

https://github.com/j178/leetgo
(base)
j178 commented 1 year ago

你好,1.0 版本修改了 code.cpp.cxxflagseditor.args 的格式,在 release note 中有说明解决方法:https://github.com/j178/leetgo/releases/tag/v1.0

  1. 手动在 ~/.config/leetgo/config.yaml 中修改 code.cpp.cxxflagseditor.args 为字符串
  2. 或者直接删掉 ~/.config/leetgo/config.yaml, 然后重新执行 leetgo init