docker容器发布go项目出现以下问题:

panic: time: missing Location in call to Time.In

COPY --from=build /usr/share/zoneinfo/Asia/Shanghai /usr/share/zoneinfo/Asia/Shanghai  //注意路径

main.go

func init() {
//处理全局时区问题,删了剁手
sh, _ := time.LoadLocation("Asia/Shanghai")
time.Local = sh
}

 

定时任务:

task := cron.New()                                               //创建定时任务
task.AddFunc(sysConfig.TaskConfig.ActivityConfig, startActivity) //添加一个定时任务,可以AddFunc 多次.
task.AddFunc(sysConfig.TaskConfig.ActivityConfig, stopActivity) //添加一个定时任务,可以AddFunc 多次.
task.AddFunc(sysConfig.TaskConfig.ActivityConfig, tasks.PullA8ReceiveBills)
task.AddFunc(sysConfig.TaskConfig.ActivityConfig, tasks.SyncPurchaseApplyState)
task.AddFunc(sysConfig.TaskConfig.ActivityConfig, tasks.SyncReturnApplyState) task.Start()

时间格式化:

var dateStr = time.Now().Format("2006-01-02 15:04:05")

  

结构体:(首字母大写,不然数据库绑定无法取值)

type A8btype struct {
Usercode string
Fullname string
TelAndAddress string
CreateDate time.Time
}

  


												

panic: time: missing Location in call to Time.In的更多相关文章

  1. xv6/sh.c

    // Shell. #include "types.h" #include "user.h" #include "fcntl.h" // P ...

  2. 基于nginx的FastCGI的缓存配置

    废话不多说了, 直接上配置, 其实 fastcgi_cache 和 proxy_cache 的配置基本一样: # !缓存文件存放目录 # levels 缓存层次 # keys_zone 缓存空间名和共 ...

  3. SAP MM Storage Location Missing in MD04 Result?

    SAP MM Storage Location Missing in MD04 Result? Today I received a ticket from business team, a user ...

  4. PANIC: Missing emulator engine program for 'x86' CPU.

    获取可用的Android模拟器 1:emulator -list-avds 获取可用的模拟器的名称(只用名称) 2:  android list -avd    获取可用的模拟器(信息详细) 获取iO ...

  5. file is missing from source location:c\temp\batang.ttc

    打开注册表 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink 在右侧找到 Micr ...

  6. Description Resource Path Location Type AndroidManifest.xml file missing!

    这个问题又找了好久.国内回答的确不敢恭维. 本回答来自谷歌:   This is build issue. Go to Menu in eclipse, Project>clean then P ...

  7. Android AVD启动报错: This AVD's configuration is missing a kernel file! Please ensure the file "kernel-qemu" is in the same location as your system image.

    启动Android SDK manager重新下载安装

  8. Description Resource Path Location Type web.xml is missing and <failOnMissingWebXml> is set to true

    点击Deployment Descriptor 选择Generate Deployment Descriptor Stub. 就会在 src/main/webapp 生成WEB-INF并且有web.x ...

  9. Description Resource Path Location Type Missing artifact com.********:framework:jar:1.0.2 pom.xml /项目名 line **** Maven Dependency Problem

    问题具体描述如下图所示: 对于该问题本人是这么解决的. 在window下[Preferences]目录找到[Maven]下的[usersetting] 查看local repository 里面的路径 ...

随机推荐

  1. NAudio的使用说明

    官方网站:http://naudio.codeplex.com/ 源码:https://github.com/naudio/NAudio NuGet安装: Install-Package NAudio ...

  2. 因内存释放而引发的中断问题,dll中new的内存释放问题

    调试程序,每次关闭一个界面就会弹出中断错误. 为了确认这个问题,我将出现问题那一段代码中的函数一个个屏蔽,以此来确认到底哪个函数出现问题,缩小范围: 最后我发现,只要屏蔽掉checkIfFingerI ...

  3. Windows下配置Redis,并修改密码

    原文:Windows下配置Redis,并修改密码 Windows下配置Redis,并修改密码 下载 Redis Windows版本的GitHub链接,直接下载zip文件解压到指定文件夹下或者下载msi ...

  4. WPF应用程序如何重启当前的Application

    // Restart current process Method 1 System.Windows.Forms.Application.Restart(); Application.Current. ...

  5. 解决 ThinkPHP Undefined class constant 'MYSQL_ATTR_INIT_COM

    这是 php.ini 配置所导致: 放开php配置文件中被注释掉的.dll引用即可. extension=php_mysql.dllextension=php_mysqli.dllextension= ...

  6. Android零基础入门第88节:Fragment显示和隐藏、绑定和解绑

    在上一期我们学习了FragmentManager和FragmentTransaction的作用,并用案例学习了Fragment的添加.移除和替换,本期一起来学习Fragment显示和隐藏.绑定和解绑. ...

  7. linux输出信息调试信息重定向

    最近在做一个android系统移植的项目,所使用的开发板com1是调试串口,就是说会有uboot和kernel的调试信息打印在com1上(ttySAC0).因为后期要使用ttySAC0作为上层应用通信 ...

  8. 基于CKEditor 你能做很多App。CKEditor 4.5 and CKFinder 3 beta 发布

    直击现场 CKEditor 4.5 and CKFinder 3 beta 发布 oschina 发布于: 2015年04月10日 (0评) 分享到:    收藏 +5 4月18日 武汉 源创会开始报 ...

  9. Delphi中inherited问题

    inherited Create(AOwner); 和直接写inherited有区别吗 有区别,inherited Create是指定调用父类的Create方法,当然你也可以inherited Des ...

  10. shell多线程(3)while循环

    start="2018-06-17" end="2018-07-01" min=`date -d "${start}" +%Y%m%d` m ...