Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4067)

Delta Between Two Patch Sets: names/environ.go

Issue 12473043: names: add ParseTag
Left Patch Set: Created 10 years, 7 months ago
Right Patch Set: names: add ParseTag Created 10 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « [revision details] ('k') | names/machine.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2013 Canonical Ltd. 1 // Copyright 2013 Canonical Ltd.
2 // Licensed under the AGPLv3, see LICENCE file for details. 2 // Licensed under the AGPLv3, see LICENCE file for details.
3 3
4 package names 4 package names
5 5
6 import "strings" 6 import "strings"
7 7
8 // EnvironTag returns the tag of an environment with the given name. 8 // EnvironTag returns the tag of an environment with the given name.
9 func EnvironTag(name string) string { 9 func EnvironTag(name string) string {
10 return makeTag(EnvironTagKind, name) 10 return makeTag(EnvironTagKind, name)
11 } 11 }
12 12
13 // IsMachine returns whether id is a valid environment id. 13 // IsEnvironment returns whether id is a valid environment id.
14 // TODO(rog) stricter constraints 14 // TODO(rog) stricter constraints
15 func IsEnvironment(name string) bool { 15 func IsEnvironment(name string) bool {
16 return !strings.Contains(name, "/") 16 return !strings.Contains(name, "/")
17 } 17 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b