我最近在玩AppEngine并遇到了以下代码的问题,其中似乎写入数据存储区的唯一值是Date.我花了一些时间敲打着这个,发现通过简单地将结构中的第一个字符大写固定它!
我想知道是否有其他人遇到过这个并且知道为什么我不能在数据存储区的Golang结构中使用小写成员名称?我认为这可能是Google AppEngine处理结构写入方式的错误.
这是问题代码:
package main
import (
"fmt"
"net/http"
"time"
"appengine"
"appengine/datastore"
)
/* This is the problem struct */
type storeVal struct {
firstName string //FirstName works
lastName string //LastName works
email string //Email works
password string //Password works
Date time.Time
}
func init() {
http.HandleFunc("/", handle)
http.ListenAndServe(":8080", nil)
}
func handle(w http.ResponseWriter, r *http.Request) {
c := appengine.NewContext(r)
/* Write values to DataStore */
e1 := storeVal{
firstName: "Bob", //FirstName works
lastName: "Smith", //lastName works
email: "bob.smith@test.com", …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用带有 SSL 的服务器运行 Leaflet.js,但在获取文件时出现类似于以下内容的错误:
GET https://tile.openstreetmap.org/12/1213/1481.png net::ERR_INSECURE_RESPONSE
Run Code Online (Sandbox Code Playgroud)
Github 上有一个已关闭的问题,据说可以通过更改请求来解决
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
Run Code Online (Sandbox Code Playgroud)
到
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
Run Code Online (Sandbox Code Playgroud)
但是,即使我尝试导航到链接https://tile.openstreetmap.org/12/1213/1481.png,我也会收到一条错误消息,指出“NET::ERR_CERT_COMMON_NAME_INVALID”。
有人找到了解决方案吗?
谢谢!