...

Text file src/cmd/gofmt/testdata/rewrite6.input

Documentation: cmd/gofmt/testdata

     1//gofmt -r=fun(x)->Fun(x)
     2
     3// Copyright 2013 The Go Authors. All rights reserved.
     4// Use of this source code is governed by a BSD-style
     5// license that can be found in the LICENSE file.
     6
     7// Rewriting of calls must take the ... (ellipsis)
     8// attribute for the last argument into account.
     9
    10package p
    11
    12func fun(x []int) {}
    13
    14func g(x []int) {
    15	fun(x)    // -r='fun(x)->Fun(x)' should rewrite this to Fun(x)
    16	fun(x...) // -r='fun(x)->Fun(x)' should not rewrite this
    17}

View as plain text