首页 > 解决方案 > 新 Go 服务上的 Arc lint 错误,解析输出时出错

问题描述

在服务上运行 arc lint

我看到这个错误

 Exception 
    Some linters failed:
- Exception: Linter failed to parse output!

  STDOUT


  STDERR
  <standard input>:40:1: expected statement, found 'package'
  <standard input>:59:27: expected ';', found error

(Run with `--trace` for a full exception trace.)

它突然开始发生。

标签: lintgolint

解决方案


我面临着类似的问题。这是解决相同问题的观察结果。每当您执行lint时,它都会相应地自动调整代码。如果文件末尾不存在新行,请lint复制整个文件,以便代码如下所示

package mypackage

import (
    "go.uber.org/fx"
)

// Module is an FX module used when initializing the app
var Module = fx.Provide(
    NewNewClient,
package mypackage

import (
    "go.uber.org/fx"
)

// Module is an FX module used when initializing the app
var Module = fx.Provide(
    NewNewClient,
)

请注意,此处重复了包,因此会导致问题。


推荐阅读