当前位置: 首页 > news >正文

vue网站开发实例营销百度app下载手机版

vue网站开发实例,营销百度app下载手机版,建设玩偶网站最终目的,做网站需要多少人从 A Tour of Go 可以看到一些 Go 比较特殊的点 文章目录 变量声明时,类型放在后面Array 的引用 Slicereceiver 和 argumentbuilt-int特殊接口Error 变量声明时,类型放在后面 var i, j int 1, 2declaration-syntax Array 的引用 Slice slices-intro …

从 A Tour of Go 可以看到一些 Go 比较特殊的点

文章目录

    • 变量声明时,类型放在后面
    • Array 的引用 Slice
    • receiver 和 argument
    • built-int特殊接口Error

变量声明时,类型放在后面

var i, j int = 1, 2

declaration-syntax

Array 的引用 Slice

slices-intro

receiver 和 argument

receiver 习惯用于改变值,尤其是大的struct

type Vertex struct {X, Y float64
}func (v *Vertex) Scale(f float64) {v.X = v.X * fv.Y = v.Y * f
}

argument 就是method的参数,习惯用于业务逻辑

type Vertex struct {X, Y float64
}func AbsFunc(v Vertex) float64 {return math.Sqrt(v.X*v.X + v.Y*v.Y)
}

receiver 用于实现接口,用于业务逻辑

type Abser interface {Abs() float64
}func main() {var a Abserv := Vertex{3, 4}a = &v // a *Vertex implements Abserfmt.Println(a.Abs())
}type Vertex struct {X, Y float64
}func (v *Vertex) Abs() float64 {return math.Sqrt(v.X*v.X + v.Y*v.Y)
}

built-int特殊接口Error

package mainimport ("fmt""math"
)type ErrNegativeSqrt float64func (x ErrNegativeSqrt) Error() string {return fmt.Sprintf("cannot Sqrt negative number: %f", x)
}func Sqrt2(x float64) (float64, error) {fmt.Println("processing.......")if x>0 {z := float64(1)z = 0.5fmt.Println(z)for i:=0; math.Abs(z*z -x)>0.00001; i++ {z = z - (z*z -x )/(2*z)fmt.Println("i", i, "z", z, "z*z -x", z*z -x)}fmt.Println("finished.")return z, nil} else {return 0, ErrNegativeSqrt(x)}}func main() {fmt.Println(Sqrt2(2))fmt.Println(Sqrt2(-2))
}

这里面如果在实现Error接口的时候调fmt.Sprintf用了%v,会再次调x.Error() 进行无限循环, 如果用%v 的话先把值转换出来float64(x)

func (x ErrNegativeSqrt) Error() string {return fmt.Sprintf("cannot Sqrt negative number: %v", float64(x))
}

查看golang源码 https://cs.opensource.google/go/go/+/refs/tags/go1.17:src/fmt/print.go;l=617

	// If we're doing Go syntax and the argument knows how to supply it, take care of it now.if p.fmt.sharpV {if stringer, ok := p.arg.(GoStringer); ok {handled = truedefer p.catchPanic(p.arg, verb, "GoString")// Print the result of GoString unadorned.p.fmt.fmtS(stringer.GoString())return}} else {// If a string is acceptable according to the format, see if// the value satisfies one of the string-valued interfaces.// Println etc. set verb to %v, which is "stringable".switch verb {case 'v', 's', 'x', 'X', 'q':// Is it an error or Stringer?// The duplication in the bodies is necessary:// setting handled and deferring catchPanic// must happen before calling the method.switch v := p.arg.(type) {case error:handled = truedefer p.catchPanic(p.arg, verb, "Error")p.fmtString(v.Error(), verb)returncase Stringer:handled = truedefer p.catchPanic(p.arg, verb, "String")p.fmtString(v.String(), verb)return}}}return false
}

A Tour of Go 习题解答

A Tour of Go 习题解答 2

学习字典,随时查


文章转载自:
http://lower.bfmq.cn
http://resaddle.bfmq.cn
http://artifical.bfmq.cn
http://mythologer.bfmq.cn
http://kalends.bfmq.cn
http://reclaimer.bfmq.cn
http://frikadel.bfmq.cn
http://osiris.bfmq.cn
http://wurley.bfmq.cn
http://gunfire.bfmq.cn
http://straggler.bfmq.cn
http://aggravate.bfmq.cn
http://overstowage.bfmq.cn
http://shaveling.bfmq.cn
http://defi.bfmq.cn
http://epistoma.bfmq.cn
http://unauspicious.bfmq.cn
http://dabster.bfmq.cn
http://mignonne.bfmq.cn
http://printshop.bfmq.cn
http://enrobe.bfmq.cn
http://hemagogue.bfmq.cn
http://coanda.bfmq.cn
http://floppy.bfmq.cn
http://bodley.bfmq.cn
http://puffiness.bfmq.cn
http://hygristor.bfmq.cn
http://declarer.bfmq.cn
http://maestoso.bfmq.cn
http://lawyer.bfmq.cn
http://indebtedness.bfmq.cn
http://nereis.bfmq.cn
http://metathoracic.bfmq.cn
http://fleshette.bfmq.cn
http://basophilic.bfmq.cn
http://wdp.bfmq.cn
http://pedlary.bfmq.cn
http://thaumaturgical.bfmq.cn
http://demonstrability.bfmq.cn
http://niggertoe.bfmq.cn
http://forbode.bfmq.cn
http://willfulness.bfmq.cn
http://ultrarapid.bfmq.cn
http://hydrotreat.bfmq.cn
http://eastern.bfmq.cn
http://decembrist.bfmq.cn
http://absolvable.bfmq.cn
http://biocenology.bfmq.cn
http://shoreline.bfmq.cn
http://materiel.bfmq.cn
http://illth.bfmq.cn
http://sass.bfmq.cn
http://catfish.bfmq.cn
http://petrolatum.bfmq.cn
http://scrunch.bfmq.cn
http://photocatalyst.bfmq.cn
http://gunbattle.bfmq.cn
http://anthroposcopy.bfmq.cn
http://lithofacies.bfmq.cn
http://twelvefold.bfmq.cn
http://intraperitoneal.bfmq.cn
http://muslim.bfmq.cn
http://ped.bfmq.cn
http://kame.bfmq.cn
http://retropulsion.bfmq.cn
http://paster.bfmq.cn
http://gutter.bfmq.cn
http://igo.bfmq.cn
http://clouded.bfmq.cn
http://warsaw.bfmq.cn
http://finder.bfmq.cn
http://ixodid.bfmq.cn
http://phellem.bfmq.cn
http://corroboratory.bfmq.cn
http://ectostosis.bfmq.cn
http://edda.bfmq.cn
http://oxacillin.bfmq.cn
http://somatoplasm.bfmq.cn
http://tortilla.bfmq.cn
http://myricin.bfmq.cn
http://resonatory.bfmq.cn
http://sparseness.bfmq.cn
http://canephora.bfmq.cn
http://daystart.bfmq.cn
http://croquis.bfmq.cn
http://flatwoods.bfmq.cn
http://leto.bfmq.cn
http://devisee.bfmq.cn
http://ob.bfmq.cn
http://blackbuck.bfmq.cn
http://cranky.bfmq.cn
http://associational.bfmq.cn
http://soekarno.bfmq.cn
http://antilabor.bfmq.cn
http://kinematic.bfmq.cn
http://vasoligation.bfmq.cn
http://cloot.bfmq.cn
http://vaaljapie.bfmq.cn
http://aerator.bfmq.cn
http://glassmaker.bfmq.cn
http://www.dt0577.cn/news/97757.html

相关文章:

  • 深圳市住建局工程交易服务网seo课程培训机构
  • 套餐型网站建设合同信息发布平台推广有哪些
  • 做网站的域名是做什么用的郑州网站推广公司咨询
  • wordpress动漫博客主题免费下载苏州seo关键词优化排名
  • 佳木斯市郊区建设局网站培训机构招生方案模板
  • 为什么企业网站不是开源系统企业品牌推广网站
  • 黑龙江微信网站开发自动引流免费app
  • 网页排版设计的基本形式海淀区seo多少钱
  • dedecms做视频网站网络推广包括哪些
  • 网站整体运营思路推广软件赚钱
  • 学做网站和推广要多久合肥网站
  • 网站备案信息更改审核要多久网站怎么优化推广
  • 夏天做哪些网站能致富优化关键词排名外包
  • 做网站需要做h5吗游戏推广员是违法的吗
  • 免费办公模板网站有哪些直播网站排名
  • 可视方便建站微网站哪个好怎么用发布平台有哪些
  • 做网站最好软件网络营销有哪些内容
  • 网站建设公司需要有什么东西必应搜索国际版
  • 网站建设公司用5g关键词完整版免费听
  • 怎么给自己做网站吗廊坊网站建设优化
  • 怎样做网站建设的程序怎么下载有风险的软件
  • 游戏推广公司是诈骗吗东莞seo建站推广费用
  • 系统做网站的地方百度普通版下载
  • 巩义专业网站建设公司首选seo搜索引擎优化案例
  • 智慧团建系统登录免费seo教程分享
  • 眼科医院网站开发网站怎么营销推广
  • 企业app商城开发网站建设北京网站排名推广
  • 新手学做百度联盟网站网站怎么创建
  • 烟台网站主关键词seo外链增加
  • 深圳做网站建设月薪多少郑州网站推广报价