$18 GRAYBYTE WORDPRESS FILE MANAGER $81

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/lib/golang/src/cmd/fix/

HOME
Current File : /lib/golang/src/cmd/fix//printerconfig.go
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package main

import "go/ast"

func init() {
	register(printerconfigFix)
}

var printerconfigFix = fix{
	name: "printerconfig",
	date: "2012-12-11",
	f:    printerconfig,
	desc: `Add element keys to Config composite literals.`,
}

func printerconfig(f *ast.File) bool {
	if !imports(f, "go/printer") {
		return false
	}

	fixed := false
	walk(f, func(n any) {
		cl, ok := n.(*ast.CompositeLit)
		if !ok {
			return
		}
		se, ok := cl.Type.(*ast.SelectorExpr)
		if !ok {
			return
		}
		if !isTopName(se.X, "printer") || se.Sel == nil {
			return
		}

		if ss := se.Sel.String(); ss == "Config" {
			for i, e := range cl.Elts {
				if _, ok := e.(*ast.KeyValueExpr); ok {
					break
				}
				switch i {
				case 0:
					cl.Elts[i] = &ast.KeyValueExpr{
						Key:   ast.NewIdent("Mode"),
						Value: e,
					}
				case 1:
					cl.Elts[i] = &ast.KeyValueExpr{
						Key:   ast.NewIdent("Tabwidth"),
						Value: e,
					}
				}
				fixed = true
			}
		}
	})
	return fixed
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
16 Dec 2025 9.30 PM
root / root
0755
buildtag.go
1.214 KB
4 Dec 2025 6.06 PM
root / root
0644
cftype.go
3.455 KB
4 Dec 2025 6.06 PM
root / root
0644
context.go
0.498 KB
4 Dec 2025 6.06 PM
root / root
0644
doc.go
1.393 KB
4 Dec 2025 6.06 PM
root / root
0644
egltype.go
1.141 KB
4 Dec 2025 6.06 PM
root / root
0644
fix.go
14.027 KB
4 Dec 2025 6.06 PM
root / root
0644
gotypes.go
1.689 KB
4 Dec 2025 6.06 PM
root / root
0644
jnitype.go
1.244 KB
4 Dec 2025 6.06 PM
root / root
0644
main.go
5.558 KB
4 Dec 2025 6.06 PM
root / root
0644
netipv6zone.go
1.319 KB
4 Dec 2025 6.06 PM
root / root
0644
printerconfig.go
1.106 KB
4 Dec 2025 6.06 PM
root / root
0644
typecheck.go
20.095 KB
4 Dec 2025 6.06 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF