为了账号安全,请及时绑定邮箱和手机立即绑定

golang 在编译时删除 const 字符串中的字符(用于可读性)(空格、\n 和 \t)

golang 在编译时删除 const 字符串中的字符(用于可读性)(空格、\n 和 \t)

Go
三国纷争 2023-06-26 16:44:10
空格对于缩进 url、sql 查询很有用,以使其更具可读性。有没有办法在 golang 编译时从 const 字符串中删除字符?ex: (runtime version)const url = `https://example.com/path?attr1=test&attr2=test`// this is the code to be replacedurlTrim := strings.Replace(strings.Replace(url, "\n", "", -1))
查看完整描述

目前暂无任何回答

  • 0 回答
  • 0 关注
  • 125 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号