我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何检测用户是否按下了按键并继续

I am new to Go, and wanted to display a text to the user and wait for the user to press any key. As soon as the user presses a key, it should proceed to the next line of code else it should stay there. How do we achieve that in Go?

Let's say the text is: "Press any key to proceed..." and I display as:

fmt.Printf(Press any key to proceed...")

After this how do I detect whether a key was pressed in order to continue?

近期文章

  • 如何在yocto构建的自定义配方中包括文件
  • go / importer.Import在生产中返回错误“找不到进口”
  • 用Bleve斜杠索引/搜索内容
  • 如何使用go和aws-sdk覆盖s3预签名PUT URL上的文件名
  • 在struct标记中使用表名称时,SQLX“缺少目标名称”
  • 创建参数为字节数组的查询
  • 如何从Pem文件中获取subject_hash(md5)
  • Go AppEngine不会以goapp开头
  • GO通道,避免死锁(比读取所有通道更好的解决方案)
  • Beego热编译websocket配置问题
  • 如何解决接口{}是字符串,而不是golang中的[] uint8? [重复]
  • 使用Windows使用Golang与db2服务器连接
  • mongodb查询一个数组中一个数组中的一个数组
  • 如何解码恒星XDR
  • 没有数据通过Olivere Golang插入ElasticSearch
  • 如何检测已删除的文件?
  • 捆绑软件:在当前目录中找不到软件包:PWD中没有可构建的Go源文件
  • Golang + Postgres存储Gob数据
  • Elastic Go找不到文件
  • 如何在Golang中获取Windows设备详细信息

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华