LoginSignup
2
0

More than 1 year has passed since last update.

excelizeをgo installするとエラー

Last updated at Posted at 2021-08-02

excelizeをインストールする際に下記のエラー

ラスト2行を訳すとgithub.com/xuri/excelize/v2のパスが必要だけど、github.com/360EntSecGroup-Skylar/excelize/v2が宣言されているよとのこと
ついこの間まで使えていたので、なんか変更が入ったみたい

$ go install github.com/360EntSecGroup-Skylar/excelize/v2
go: finding module for package github.com/360EntSecGroup-Skylar/excelize/v2
go: downloading github.com/360EntSecGroup-Skylar/excelize/v2 v2.4.1
go: found github.com/360EntSecGroup-Skylar/excelize/v2 in github.com/360EntSecGroup-Skylar/excelize/v2 v2.4.1
go: github.com/360EntSecGroup-Skylar/excelize/v2: github.com/360EntSecGroup-Skylar/excelize/v2@v2.4.1: parsing go.mod:
    module declares its path as: github.com/xuri/excelize/v2
            but was required as: github.com/360EntSecGroup-Skylar/excelize/v2

公式のgithubを確認

Installationのところに

If your packages are managed using Go Modules, please install with following command.
go get github.com/xuri/excelize/v2

とあるので、まずmain.goのインポートのパスを変更

import (
    "fmt"
    "github.com/xuri/excelize/v2"
)

次に実行コマンドに指定のパスを変更

$ go install github.com/xuri/excelize/v2
go: finding module for package github.com/xuri/excelize/v2
go: found github.com/xuri/excelize/v2 in github.com/xuri/excelize/v2 v2.4.1

成功しました

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0