Go create a project

Source: Internet
Author: User
1.0 enter the Project Creation folder CD $ gopath/src2.0 create the project mkdir localeasy3.0 create go file touch helloworld. go4.0 open and edit open helloworld. Go

Code in helloworld. Go

Package localeasy // (package-like classes in OC are encapsulated) func SQRT (x float64) float64 {/* FUNC: the keyword * SQRT (x float64) of the declarative Method) float64 * SQRT: method name in objectc * x float64: form parameter of the method-data structure similar to the variable declaration in OC, except that the variable name is followed by the Data Type * float64: type of return value in OC */Z: = 0.0 for I: = 0; I <1000; I ++ {z-= (z * z-x) /(2 * x)} return z}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.