package main

// 参考文档:
// https://github.com/Unknwon/the-way-to-go_ZH_CN/blob/master/eBook/05.2.md import (
"fmt"
"strconv"
) func main() {
var orig string = "ABC"
// var an int
var newS string
// var err error fmt.Printf("The size of ints is: %d\n", strconv.IntSize)
// anInt, err = strconv.Atoi(origStr)
an, err := strconv.Atoi(orig)
if err != nil {
fmt.Printf("orig %s is not an integer - exiting with error\n", orig)
return
} fmt.Printf("The integer is %d\n", an)
an = an +
newS = strconv.Itoa(an)
fmt.Printf("The new string is: %s\n", newS)
}

learn go error的更多相关文章

  1. container error log

    learn from error- Error: org.apache.hadoop.mapreduce.task.reduce.Shuffle$ShuffleError: error in shuf ...

  2. A Realistic Evaluation of Memory Hardware Errors and Software System Susceptibility

    http://www.cs.rochester.edu/~kshen/papers/usenix2010-li.pdf Abstract Memory hardware reliability is ...

  3. 转:PHP – Best Practises

    原文来自于:http://thisinterestsme.com/php-best-practises/ There are a number of good practises that you s ...

  4. 10个常见的JavaScript BUG

    译者按: 安全起见,在开发中我基本不用==. 原文: 10 COMMON JAVASCRIPT BUGS AND HOW TO AVOID THEM 译者: Fundebug 为了保证可读性,本文采用 ...

  5. [C7] Andrew Ng - Sequence Models

    About this Course This course will teach you how to build models for natural language, audio, and ot ...

  6. 解决Error:All flavors must now belong to a named flavor dimension. Learn more at...

    低版本的gradle里面不会出现这个错误,高版本出现,不多说,看如何解决 在defaultConfig{}中添加:flavorDimensions "default" 保证所有的f ...

  7. 解决Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com

    主app的build.gradle里面的 defaultConfig { targetSdkVersion:*** minSdkVersion :*** versionCode:*** version ...

  8. Failed to execute "C:\learn\C\程序练习\1.exe": Error 0: 操作成功完成。 请按任意键继续. . .问题解决

    在DEV中编译运行时出现以上提示,原因是该文件被杀毒软件隔离了,认为它是病毒文件 解决办法,找到该文件进行恢复

  9. ios AFNetworking 3.0 报错 : *** Assertion failure in -[AFHTTPRequestSerializer requestWithMethod:URLString:parameters:error:],

    AFNetWorking[:] *** Assertion failure -- :::] *** Terminating app due to uncaught exception 'NSInter ...

随机推荐

  1. POJ-2418 Hardwood Species(二叉搜索树)

    思路就是先将每个单词存进二叉树中,没出现一次,修改该单词所在结点的cnt++: 最后通过递归中序遍历输出结果. 思路很清晰,主要注意一下指针的使用,想一想为什么要这么用? 简单的解释就是,insert ...

  2. maven--spring-boot-starter-parent 小结

    Maven中的dependency的scope作用域详解 https://blog.csdn.net/itchiang/article/details/45009057 https://blog.cs ...

  3. 面试笔试总结(二)之 C++基础

    上节,一定要写出基于引用计数的智能指针 明白单例模式 会写出代码 复习: 1- 2- 推荐leveldb ....是c++的写代码很规范的地方?比如智能指针在这里... 对类进行改造 可以改成Sing ...

  4. linux环境变量 export命令详解

    由host $ export DVSDK="${HOME}/ti-dvsdk_dm368-evm_xx_xx_xx_xx"引发的问题 1.${HOME}:首先, HOME 是个变量 ...

  5. django框架搭建web服务

    一.工具 环境:windows 7 python 2.7.7     下载地址:https://www.python.org/downloads/release/python-2713/   ps:这 ...

  6. centos 6 安装python2.7和pip

    由于scrapy1.0的发布,想在Linux上测试,所以安装了centos6.6:但是它的python版本为2.6,很多东西都不支持,所以需要升级为2.7: 首先是在window7上安装虚拟机,然后安 ...

  7. LM3S之boot loader学习笔记-1

    LM3S之boot loader学习笔记-1 彭会锋 (首先声明,此系列文章编写参考了很多资料,其中一些内容是原版内容的引用和整理,并加入了一些自己的见解,我已经尽量标明引用部分,如有未全部标注部分, ...

  8. linux下如何安装lua

    1.下载lua包并解压 wget -c http://www.lua.org/ftp/lua-5.3.0.tar.gz  tar zxvf lua-5.3.0.tar.gz 2.下载libreadli ...

  9. Pycharm-professional-2017.2.3破解安装

    初次接触Python,大神推荐使用PyCharm IDE工具,作为小白初生牛犊不怕虎,上手就来最新版的,这也许不是最好的选择,但在以后慢慢琢磨深入之后,会选择适合自己的版本,现参考把安装过程分享出来. ...

  10. day25 crm 权限管理 通用的增删改查框架

    代码: https://github.com/liyongsan/git_class/tree/master/day25/LuffyCRM