Home> Common Problem> body text

How many keywords are there in golang?

DDD
Release: 2023-06-05 14:50:52
Original
1171 people have browsed it

There are 25 golang keywords, namely: 1. break; 2. default; 3. func; 4. interface; 5. select; 6. case; 7. chan; 8. const; 9. continue; 10, defer; 11, go; 12, map; 13, struct; 14, else; 15, goto; 16, package; 17, switch; 18, fallthrough, etc.

How many keywords are there in golang?

The operating environment of this article: Windows 10 system, go1.20 version, dell g3 computer.

There are 25 golang keywords, which are:

  • break: exit the loop

  • default: select the structure default item (switch, select)

  • func: Define function

  • interface: Define interface

  • select :channel

  • case: select structure tag

  • chan: define channel

  • const: constant

  • continue: skip this loop

  • defer: delay execution content (finishing work)

  • go: Concurrent execution

  • map: map type

  • struct: define structure

  • else: select structure

  • goto: jump statement

  • package: package

  • ##switch : Selection structure

  • fallthrough: Process control

  • if: Selection structure

  • range: from Get elements from slice, map and other structures

  • type: define type

  • for: loop

  • import: Import package

  • return: Return

  • var: Define variables

The above is the detailed content of How many keywords are there in golang?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!