无法将 r.Condition.AgeInDays(int64 类型的变量)用作 *int64 类型的结构体字段
时间:2024-02-05
浏览:104
作者:佚名
小伙伴们对Golang编程感兴趣吗?是否正在学习相关知识点?如果是,那么本文《无法将 r.Condition.AgeInDays(int64 类型的变量)用作 *int64 类型的结构体字段》,就很适合你,本篇文章讲解的知识点主要包括。在之后的文章中也会多多分享相关知识点,希望对大家的知识积累有所帮助!
问题内容
当我将 firebase 导入 golang 文件时,我看到这个错误。 我是新手,正在学习 golang,请帮我解决这些问题 我的代码:
package main
import (
"fmt"
"log"
"firebase.google.com/go"
"google.golang.org/api/option"
)
func helloworld(c *fiber.ctx) {
c.send("hello world")
}
func main() {
//connect db
sa := option.withcredentialsfile("./webgolang.json")
app, err := firebase.newapp(context.background(), nil, sa)
client, err := app.firestore(context.background())
if err != nil {
log.fatalln(err)
}
defer client.close()
//
app := fiber.new()
app.get("/", helloworld)
setuproutes(app)
app.listen(4000)
}
这是错误
C:\Users\HP\go\pkg\mod\cloud.google.com\go\[email protected]\bucket.go:1504:30: cannot use r.Condition.AgeInDays (variable of type int64) as type *int64 in struct literal C:\Users\HP\go\pkg\mod\cloud.google.com\go\[email protected]\bucket.go:1592:30: cannot use rr.Condition.Age (variable of type *int64) as type int64 in struct literal
正确答案
将云存储版本升级到v1.26.0,因此如果您转到go.mod文件,您应该有以下内容:
cloud.google.com/go/storage v1.26.0 // indirect
理论要掌握,实操不能落!以上关于《无法将 r.Condition.AgeInDays(int64 类型的变量)用作 *int64 类型的结构体字段》的详细介绍,大家都掌握了吧!如果想要继续提升自己的能力,那么就来关注golang学习网公众号吧!
本文内容来源于互联网,如有侵权请联系删除。
近期热门
11.18
11.15
站内热门
最新文章
11.28
热门专题
