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

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 关注
  • 80 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信