Github user rob05c commented on a diff in the pull request:
https://github.com/apache/incubator-trafficcontrol/pull/325#discussion_r107810629
--- Diff: traffic_ops/experimental/go-api/tenant/EndPointSeeder.go ---
@@ -0,0 +1,202 @@
+package tenant
+
+/*
+ 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
+
+ http://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.
+*/
+
+
+import (
+ "database/sql"
+ "encoding/json"
+ "net/http"
+ "fmt"
+ "time"
+
+ "github.com/gorilla/mux"
+ _ "github.com/lib/pq"
+)
+
+
+//TODO(nirs) polymorphisem
+
+/////BASE - COMMON TO ALL SEEDERS (needs to move to another package)
+/// Defintions
+type EndpointSeeder struct{
+ myDb *sql.DB
+}
+
+/// Interface
+func NewEndpointSeeder(aDb *sql.DB) *EndpointSeeder {
+ endPointSeeder := new(EndpointSeeder)
+ endPointSeeder.myDb = aDb
+ return endPointSeeder
+}
+
+func (aEndpointSeeder *EndpointSeeder) Seed (aRouter *mux.Router,
aApiPrefix string) {
--- End diff --
`aEndpointSeeder` and `aRouter` aren't idiomatic Go. The "a" is
unnecessary, and short names are preferred. Consider `seeder`,
`endpointSeeder`, or for a function this short, even `es` or `s`. See
https://golang.org/doc/effective_go.html#names
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---