douzhan3900 2019-03-06 20:26
浏览 196

输入密码时是否有golang函数来填充特殊字符?

I would like to know if there is a way in Go to populate a password output with special characters when you are typing the password.

For example, I want to type the word "password" in the password field when it prompts me for the password. I want the output on the screen to look like this:

Enter Password: ********

Where the "********" are the characters of "password". Does GOLANG have something that will allow me to do this?

  • 写回答

1条回答 默认 最新

  • dsns47611 2019-03-06 22:23
    关注

    Take a look at this.

    I know, it might not answer your question. But, this is an alternative to the answer. Instead of using ********* to mask the password, actually it will use the standard "blank" password masking on the terminal.

    Here is the screenshot of the program when executed: Screenshot of running program

    You can see at the Enter Password: part, that it is blank instead of asterisks ********* or other symbols.

    评论

报告相同问题?