1
0
mirror of https://github.com/golang/go synced 2024-11-22 04:34:39 -07:00

cmd/go: add tests for loading invalid import path

This commit is contained in:
Shengyu Zhang 2021-12-17 11:41:36 +08:00
parent 0e49fb4d2b
commit 990c14cec8

View File

@ -0,0 +1,14 @@
# Tests issue 49137. The following commands should not panic any way.
! go list '"a"'
stderr 'malformed import path "\\"a\\"": invalid char ''"'''
! go build '' -ldflags='-X "main.Tags="'
stderr 'malformed import path "-ldflags=-X \\"main.Tags=\\"": leading dash'
-- go.mod --
module m
go 1.16
-- main.go --
package main