Getting error on upgrading Go version from 1.12 to 1.22.3

I’m trying to update the Go version in my project, but I’m encountering numerous errors. Here is the problem I’m facing:

Directory Structure:

/root/go/src/bitbucket.org/Learning/Web_Project

Contents of Web_Project:

  • main.go

  • build

  • handler/ (contains some API files)

  • util/ (contains some common code)

  • vendor/ (contains external packages)

    • bitbucket.org/Learning/goauth

    • bitbucket.org/Learning/relay

    • github.org, golang.org, go.uber.org, etc. (contains some files)

When building the binary using Go version 1.12, it generates the binary successfully. However, after changing the Go version from 1.12 to 1.22.3 and running the build script, I get the following error:

go: cannot find main module, but found .git/config in /root/go/src/bitbucket.org/Learning/Web_Project to create a module there, run: go mod init

After running go mod init, I then run go mod tidy. Some modules are fetched successfully, but for some modules, I get the following error:

go: found github.com/golang/snappy in github.com/golang/snappy v0.0.4 go: found gopkg.in/linkedin/goavro.v1 in gopkg.in/linkedin/goavro.v1 v1.0.5 bitbucket.org/Learning/goauth: cannot find module providing package bitbucket.org/Learning/goauth: module bitbucket.org/Learning/goauth: git ls-remote -q origin in /root/go/pkg/mod/cache/vcs/11f96d93a23a7d4a46dea5201561ac9dc651d3fed77e6cac3e339a0e30af0e11: exit status 128: The requested repository either does not exist or you do not have access. If you believe this repository exists and you have access, make sure you're authenticated. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. go: bitbucket.org/Learning/Web_Project imports bitbucket.org/Learning/gorelay: bitbucket.org/Learning/[email protected]: verifying module: bitbucket.org/Learning/[email protected]: reading https://sum.golang.org/lookup/bitbucket.org/Learning/[email protected]: 404 Not Found

I also tried go mod vendor, which shows this output:

go: bitbucket.org/Learning/Web_Project imports bitbucket.org/Learning/goauth: no required module provides package bitbucket.org/Learning/goauth; to add it: go get bitbucket.org/Learning/goauth

When I run the command go get bitbucket.org/Learning/goauth, I get the following error:

go: module bitbucket.org/Learning/goauth: git ls-remote -q origin in /root/go/pkg/mod/cache/vcs/67f96d93a23a7d4a46dea5201561ac9dc651d3fed77e6cac3e339a0e30af0e6d: exit status 128: The requested repository either does not exist or you do not have access. If you believe this repository exists and you have access, make sure you’re authenticated. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

FYI: I am using git with SSH, and git pull, fetch, push are working fine.

Can someone help me resolve these issues?

New contributor

Akash Kaplesh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật