Files
wire/internal/wire/testdata/VarValue/foo/foo.go
Ross Light 338b1da068 wire: store value expressions in package variables (google/go-cloud#135)
The code assigns a local unnecessarily, but this should have no
appreciable effect on semantics, just readability.

Fixes google/go-cloud#104
2018-11-13 13:16:45 -08:00

27 lines
799 B
Go

// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package main
import "fmt"
func main() {
// Mutating value; value should have been stored at package initialization.
msg = "Hello, World!"
fmt.Println(injectedMessage())
}
var msg string = "Package init"